web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / html display variable ...
Power Apps
Unanswered

html display variable images in a html table

(0) ShareShare
ReportReport
Posted on by

Hi there!

 

I want to create a report containing many items from a Gallery (filtered in PowerApps). Each item has a grade. Upon this grade, a different image should appear. Then, by clicking on a button, the html field is send to power automate to create a pdf.

I manage to get an image in the pdf document, but I cannot manage to change the image upon the grade.

On Start of the app, I set a variable for each grade, containing the image

(for example:

Set(varMatrix22,"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAwADAAAD/4REQRX...")

)

 

My report built in html is as following:

 

<table style:'width:100%'>
<tr>
<th style='width:70%'> Risk description</th>
<th>Evaluation</th> <th>Divers to be determined later</th>
</tr>"&Concat(RenameColumns(GalleryReport_1.AllItems,"ID","MainID"),"<tr><td>"&Title&"<br>"&Description&"<table>"&Concat(Sort(Filter(ComplianceRisksAP,IDMainList=MainID),ActionNumber,Ascending),"<tr><td>"&ActionNumber&". "&Title&"</td>
<td> "&PourcentageAchievement&"</td></tr>")&"
</table>"&"</td>
<td>Inherent risk: "&ProbableRisk&"<br> MatrixImage:"&MatrixValue&"
<br>
<img src='"& varMatrix22 &"'>
</td><td>" & QuantiOrUQ &"
</tr>")&"
</table>

 

I would need to change the part in red (22) to be variable (value being 11,22,33,43,44,55, for example, depending on the items in the filtered gallery), or change the whole varMatrix22.

The value comes from the gallery (based on a SharePoint list, column MatrixValue as variable to get the right image).

 

Has anybody an idea how I could do this?

If not directly in Powerapps (favorite solution), maybe with power automate?

 

Thanks a lot in advance for you help.

 

Kind regards,

 

Christelle

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

     

    You will need to use an If() or Switch() to execute the correct variable name. Here is an example that assumes MatrixValue returns a number that relates to an image variable:

     

    <img src='"& Switch( MatrixValue, 11, varMatrix11, 22, varMatrix22, 33, varMatrix33 , 44, varMatrix44, 45, varMatrix45) &"'>

     

     

     

  • Christelle Profile Picture
    on at

    Dear Jeff,

     

    it works perfectly. I would never have come to this syntax. I had the idea of if or switch but needed the help.

    Now I can stop working during my vacation and start baking for Christmas eve...

    Thanks a lot!

    KR,

     

    Christelle

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard