0

I am trying to conditionally hide tabs based on the output of a certain table. Currently I am attempting to set the navigationHidden property of the page to false like so:

"navigationHidden": "{{cell(SomeChart.result, 0, \"SomeField\").asString() == \"SomeString\"}}"

However, I believe this is causing issues because the JSON expects a boolean value and not a string. When I try setting navigationHidden to "false" (wrapped in quotes) it is hidden, which is not the behavior I would expect. However, when I take the quotes off from my binding, the dashboard complains about invalid JSON and will not save. Any advice?

0

When passing boolean values through a binding you will need to return them as an object. In your step called SomeChart you will want to create a new dimension that will return either true or false depending on the conditions.

q = load \"dataset\";
q = group q by all;
q = foreach q generate sum('amount') as 'amount', 
(case when sum('amount') > 1000000 then false else true end) as 'booleanField';

Once you have the boolean logic in the step, your binding can be the following:

"navigationHidden": "{{cell(SomeChart.result, 0, \"booleanField\").asObject()}}"

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.