cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamH
Post Patron
Post Patron

Using DataCardValue in HTML and hiding / changing output

Hi All, 

 

I'm in the middle of creating a PDF report export function, I have a bunch of toggle values (true/false) and I want to change their output to:

 

If datacardvalue (false) then hide the text "false" or change its colour to white

If datacardvalue (true) then change that to colour the cell green rather than the words true

 

The HTML code I am using is basic

</tr>
<tr style='height: 31px;'>
<td style='width: 25.6155%; height: 31px;'>Time management</td>
<td style='width: 12.8316%; height: 31px;'>" & DataCardValue68.Value &"</td>
<td style='width: 14.3939%; height: 31px;'>" & DataCardValue69.Value &"</td>
<td style='width: 15.8144%; height: 31px;'>" & DataCardValue70.Value &"</td>
<td style='width: 15.9565%; height: 31px;'>" & DataCardValue71.Value &"</td>
<td style='width: 15.3883%; height: 31px;'>" & DataCardValue72.Value &"</td>
</tr>

 

1 ACCEPTED SOLUTION

Accepted Solutions
timl
Super User
Super User

Hi @AdamH 

The code you would use would look something along the lines of this:

<table>
  <tr style='height: 31px;'>
    <td style='width: 25.6155%; height: 31px;'>Time management</td>
    <td style='width: 12.8316%; height: 31px;" & 
        If(DataCardValue68.Value,"background-color:Green") & "'>&nbsp;</td>
   <td style='width: 12.8316%; height: 31px;" & 
        If(DataCardValue69.Value,"background-color:Green") & "'>&nbsp;</td>
   <td style='width: 12.8316%; height: 31px;" & 
        If(DataCardValue70.Value,"background-color:Green") & "'>&nbsp;</td>
   <td style='width: 12.8316%; height: 31px;" & 
        If(DataCardValue71.Value,"background-color:Green") & "'>&nbsp;</td>
  </tr>
</table>

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi @AdamH 

The code you would use would look something along the lines of this:

<table>
  <tr style='height: 31px;'>
    <td style='width: 25.6155%; height: 31px;'>Time management</td>
    <td style='width: 12.8316%; height: 31px;" & 
        If(DataCardValue68.Value,"background-color:Green") & "'>&nbsp;</td>
   <td style='width: 12.8316%; height: 31px;" & 
        If(DataCardValue69.Value,"background-color:Green") & "'>&nbsp;</td>
   <td style='width: 12.8316%; height: 31px;" & 
        If(DataCardValue70.Value,"background-color:Green") & "'>&nbsp;</td>
   <td style='width: 12.8316%; height: 31px;" & 
        If(DataCardValue71.Value,"background-color:Green") & "'>&nbsp;</td>
  </tr>
</table>
AdamH
Post Patron
Post Patron

@timl 

That works great - Thank you !

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,278)