cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Steve0
Microsoft
Microsoft

Include image in Adaptive Card based on file extension

I would like to change the icon on my adaptive card "file upload" notification based on file extension. I have identified the file extension in my flow, I just need to figure out the logic to take that extension and place the correct URL to the Icon in my "URL" parameter for the adaptive card.
xls = http://www.contoso.com/Excelicon
xlsx = http://www.contoso.com/Excelicon"
doc = http://www.contoso.com/worddoc

 

FileNotification.jpg

1 ACCEPTED SOLUTION

Accepted Solutions

6 REPLIES 6
v-litu-msft
Community Support
Community Support

Hi @Steve0,

 

A simple method is you could create two Condition actions to determine the filename with extension whether it ends with the specified extension, if it appends the corresponding URL into the adaptive card:

Annotation 2020-05-27 163813.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

After I match on the extension how apply the correct URL through a variable of some sort? Where do I store the URL's before looking them up?

Hi @Steve0,

 

You could initialize an object variable to store these URLs, then use Expression to extract them:

Annotation 2020-05-28 164101.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I got what you showed working but I need the file extension to not be hardcoded and reference a compose statement that holds the extension. The following did not work. EXT is a compose statement holding value xlsx
variables('iconUrls')?['EXT']

Variable.jpg

Hi @Steve0,

 

Compose is an example, it could be replaced by any action.

Could you explain your desire more, maybe I misunderstand what you want.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 Kudoed Authors
Users online (2,439)