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 III
Super User III

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 III
Super User III

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,558)