cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdamH
Helper V
Helper V

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
Helper V
Helper V

@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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,067)