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>

View solution in original post

AdamH
Post Patron
Post Patron

@timl 

That works great - Thank you !

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,940)