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
Solved! Go to Solution.
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) &"'>
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) &"'>
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
202 | |
100 | |
61 | |
59 | |
57 |
User | Count |
---|---|
254 | |
163 | |
90 | |
79 | |
70 |