VolkovLabs / volkovlabs-dynamictext-panel

Business Text Panel for @grafana
https://docs.volkovlabs.io
Apache License 2.0
78 stars 14 forks source link

Cannot display conditional content. #298

Closed Maltese-Falcon closed 3 months ago

Maltese-Falcon commented 3 months ago

Thank you.

Initially I selected Render template = All data. Suggestion <li>{{{"Value #1"}}}</li> doesn't render any data at all, whatever Render template I choose. <li>{{"Value #A"}}</li> works when I select Render template = Every row, but doesn't work in conditional expression like:

{{#if (eq "Value #A" True)}}OK{{else}}NOK{{/if}} {{#if (eq "Value #A" 1)}}OK{{else}}NOK{{/if}}

When I switch to Render template = All rows, I can see value returned by <li>{{{data.0.Time}}}</li> But I cannot for the life of me figure out how to visualise <li>{{{data.0.Value #A}}}</li>????

P.S.: I was able to display conditional content with Render template=Every row and after I renamed fields with designations without spaces. I think this is something that should be included in documentation as a separate section.

mikhail-vl commented 3 months ago

@Maltese-Falcon You can use "" or [] for fields with space.

Try data.0."Value #A" or data.0.[Value #A].