Platform

 View Only

 How to use dynamic text for HTML Component Visibility?

Jump to  Best Answer
  • TBMStudio
Jaitabh Jewel Sharma's profile image
Jaitabh Jewel Sharma posted Thu December 16, 2021 12:38 AM
We'd like to make a HTML component visible/hidden based on the value of a column (Environment Type).

We've tried with the condition
<%=IF(KEOS Accounts.Environment Type="Innovation","hidden","false")%>

Whilst the HTML content returns the expected dynamic text, the Report Component Visibility still displays at.

displays as


Also, we are drilling into this report based on a specific account from a list of accounts. So originally, the HTML would evaluate to {Various}, but when we drill on to this report, that filters on a specific account, the Environment Type value would resolve to either Innovation or Production.

How do we hide the HTML component?
#TBMStudio
Jaitabh Jewel Sharma's profile image
Jaitabh Jewel Sharma  Best Answer
Update.

Firstly, thanks to @Naruki Higashimoto but that didn't work for us ... or for a number of Apptio Support folks who tried that and other approaches.

Our support case is now with P&E team to investigate.​ I'll provider further update once we hear back from them.

@Naruki Higashimoto ... if you are able to make the dyanmic HTML work, please share the screenshots of your configuration and the report outcomes for both situation - when the dynamic condition is met, as well as when it isn't. Thanks again.​
#TBMStudio
Guillermo Cuadrado's profile image
Guillermo Cuadrado

I have run many tests and couldn't get this to work. The documentation I have ("12.8.1 Reporting Guide") does not mention the syntax of the Visibility box​​ as displayed above. I tried a variation of the HTML code, removing the "<%" bits and left it as regular CT formula syntax to no avail. The HTML component displays even if the formula resolves to "hidden":
(later)
I'm starting to think that there's a misunderstanding about what the Visibility  dialog box means by...

This is the HTML component content:


I configured Visibility as follows:


And the code does resolve to "hidden":


Yet, CT displays the HTML box:


We need additional firepower here...


#TBMStudio
Jenny Franklin's profile image
Jenny Franklin

Y'all jarred my memory - I remember seeing something like this with the standard 'Service Costing' report page, but not sure it's the exact same deal, but hopefully it'll help some!  

When I go to the Service Costing report page, I see this...


And when I check it out, I see what's really there...


I went to Properties for one of the grayed out ones and this is what it has on the button...


Worth a shot?  @Jaitabh Jewel Sharma, @Guillermo Cuadrado​​
#TBMStudio
Debbie Hagen's profile image
Debbie Hagen
@Jaitabh Jewel Sharma,
Did @Jenny Franklin's suggestion work for you?​​
#TBMStudio
Guillermo Cuadrado's profile image
Guillermo Cuadrado

Sure, we can manage the appearance of buttons as described by @Jenny Franklin
What still is unclear is how to hide a report component using the Visibility button, and the Dynamic Text does not evaluate to "hidden" option:

  1. I got it to work to hide a Slicer:



  2. Tried the same with an HTML component—the original question, and this is what I found:

    1. The box would not appear if I used the same logic as above, but that is not what I would call dynamic

    2. The spirit of the question is how to get the box to appear or not, depending on the value in a column.
      I tried the following logic:
      <%=If(Service Name="My Desired Service Name","hidden","visible")%>
      Please note that this logic works inside the body of the HTML box, and correctly displays "hidden" if I Slice by the Service Name I'm interested it.
      However, when I copy and paste the If statement with the HTML tags into the Visibility text box, CT displays it no matter what.
      I tried prefixing the column name with the object it belongs to (Business Services.Service Name), but it didn't work either.


@Debbie Hagen ​​​


#TBMStudio
Jaitabh Jewel Sharma's profile image
Jaitabh Jewel Sharma

@Jenny Franklin and @Guillermo Cuadrado thank you both.

The buttons work fine, but not other components.

Same as Guillermo, we've tried numerous ways to make it dynamic / logical, but no luck. It works if we hard code "hidden", but that's not dynamic.​​

I have opened a case with Apptio Support for this.


#TBMStudio
Apptio Community Member's profile image
Apptio Community Member
Hi @Jaitabh Jewel Sharma

I have an environment using dynamic HTML component. I think there are two key points.
- One HTML component is referencing the right object (in this screenshot, Applications object and Top Application Focus field).
- Visibility field has the right function.  in this case below is the function used. 
<%=if(eval("=Projects Master Data:Count[Top Project Focus=""Yes""]") < 1,"show","hidden")%>

From the info on this thread, maybe you are missing the point 2?


#TBMStudio
Debbie Hagen's profile image
Debbie Hagen
Hi @Jaitabh Jewel Sharma,

Sorry that didn't work for you.   Thanks for the offer to share the solution with us here on Community once it's resolved.​
#TBMStudio
Apptio Community Member's profile image
Apptio Community Member
@Jaitabh Jewel Sharma

Apology, the previous post did not have big enough screenshot.  This is from one of our demo environment. On HTML object, properly setup  HTML configuration referencing the object and field you are using.

Formula: <%=if(eval("=Projects Master Data:Count[Top Project Focus=""Yes""]") < 1,"show","hidden")%>

HTML Configuration

When the data includes "Yes" on the field, report looks like this.


Report does not have HTML box displayed.



If the value only has "No" and "Yes" not included

Report looks like this with HTML config.

hope this helps. 
​​
#TBMStudio
Apptio Community Member's profile image
Apptio Community Member

Does anyone have a solution for this?


#TBMStudio
Jaitabh Jewel Sharma's profile image
Jaitabh Jewel Sharma

@Rachel Yaghoubzadeh
the last we heard from P&E was that this feature doesn't work in the dynamic manner. It only works when hard-coded with "hidden" (which is kind of redundant IMO).

Apparently, @Naruki Higashimoto was able to make it work. However, we struggled to replicate that in our instance. I believe @Guillermo Cuadrado had a similar experience.


Our view is that if Apptio Support and P&E aren't fully confident and backing a feature than I'd rather avoid using that for a production grade report.


#TBMStudio