cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ashfords
Regular Visitor

Expression giving me trouble

In order to format some bullet pointed data in a way that it flows nicely from power apps into a word document, the data needs to be edited in power automate.

 

I wrote a simple (ish) expression to replace the html line breaks which come out of power apps to a uri format that word will know and use in its content controls

replace(outputs('supportingDocs'),'<br/>',uriComponentToString('%0A'))

This expression works like a charm and does exactly what i need it to do... apart from when data comes through blank and my flow breaks..


if(empty(outputs('supportingDocs')), "Not Supplied", replace(outputs('supportingDocs'),'<br/>',uriComponentToString('%0A')))

I looked at an if statement but this expression is apparently invalid and I can't quite put my finger on why.

 

Any help would be much appreciated!!

1 ACCEPTED SOLUTION

Accepted Solutions
v-chengfen-msft
Microsoft
Microsoft

Hi @Ashfords ,

The reason for this problem is:
1. You are using double quotes around Not Supplied

Please try :

 

if(empty(outputs('supportingDocs')), 'Not Supplied', replace(outputs('supportingDocs'),'<br/>',uriComponentToString('%0A')))

 

Best Regards

Cheng Feng

View solution in original post

2 REPLIES 2
v-chengfen-msft
Microsoft
Microsoft

Hi @Ashfords ,

The reason for this problem is:
1. You are using double quotes around Not Supplied

Please try :

 

if(empty(outputs('supportingDocs')), 'Not Supplied', replace(outputs('supportingDocs'),'<br/>',uriComponentToString('%0A')))

 

Best Regards

Cheng Feng

Wow. Knew it would be something simple like that. I had a long day alright!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,599)