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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,189)