cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Why is this expression invalid?

Can anybody help me troubleshoot this expression? I'm just not seeing where the problem is. I also can't get the tooltips thing to show up in the expression editor to help me.
 
If(greater(variables('Conduct2'),50),null,concat('<img src=',variables('firebrick'),' height="25" width="',string(sub(50,(variables('Conduct'))),'">'))
 
Thanks.
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Why is this expression invalid?

Hi @Anonymous,

 

It seems that you are trying to concat a URL of an image.

I have tested the following code, please check it for a reference:

if(greater(variables('Conduct2'),50),'',concat('<img scr="',variables('firebrick'),'"','height="25" width="',string(sub(50,variables('Conduct'))),'">'))

Please take a try with it on your side.

 

Best regards,

Mabel

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

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Why is this expression invalid?

Hi @Anonymous,

 

It seems that you are trying to concat a URL of an image.

I have tested the following code, please check it for a reference:

if(greater(variables('Conduct2'),50),'',concat('<img scr="',variables('firebrick'),'"','height="25" width="',string(sub(50,variables('Conduct'))),'">'))

Please take a try with it on your side.

 

Best regards,

Mabel

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

View solution in original post

Anonymous
Not applicable

Re: Why is this expression invalid?

Thanks Mabel,

I see the problem now. I was trying to use the single quote variant of the <img> tag (because the variable I'm refrencing is a data URI), forgetting that I need to use an escape character '' , or else Flow thinks it's part of an expression, rather than a string.

Your way, with the double quotes, also works, but if you're trying to embed your image with a data URI, you need 2 single quotes in a row.

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,371)