How to display config data in a different format

Hi I have a requirement where I have to display configured data in a different way than what was originally configured (weird but they want it to be coll neat formatting, with few bells and whistles). So, I should be able to either read from CDB or my local database and display the data when user enter the ‘show’ command for various config parameters (I have leaf-list, leaf and list in my container). How do I let confd trigger my function when user tries to show the config data?
Thanks in advance!

Have you looked at the show-template CLI extension?
This will allow you to override the default show output format.

It seems show-template is for displaying tables with different labels. OK… however, I want to be able to modify the data (ex: I have a range of numbers but I want to display like a range (10-20) instead of printing all the numbers - for this, I believe, I should have some kind of daemon intervention to format… )
Section 16.27.2 does not mention anything in that aspect.

You can have the show-template at the container level as well.
Take a look at the example: examples.confd/cli/show_templates

Regarding values, you can only show them the way they are shown in an auto-rendered output.

But if you want to be free to show whatever format you like, I recommend creation an all operational view of the configuration and register data callbacks to show the output.

You can then control exactly how you want to display the values. In your range case, you can model the leaf as a string and either show integer values, or ranges. Your data provider has to know what it needs to return as a value in this case.

Thanks @nabil
Will go through the examples and try to follow callback approach.