cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jmwinters
Frequent Visitor

If Statement with Dynamic and static content

I have several if statements that check to see if a response is not empty and then put the value in a cell in a table in Excel. However I would like to add some static text to the beginning of the value when true 
 
Here is a working version of the if Statement with no static text.
 
if(not(empty(body('Get_response_details')?['r66cdfa6620fa4db4b8fced24da5554de'])),body('Get_response_details')?['r66cdfa6620fa4db4b8fced24da5554de'],'')
 
 I would like to add something like this but i cant seem to get the if statement to validate.
if(not(empty(body('Get_response_details')?['r66cdfa6620fa4db4b8fced24da5554de'])),'STATIC TEXT 'body('Get_response_details')?['r66cdfa6620fa4db4b8fced24da5554de'],'')
2 ACCEPTED SOLUTIONS

Accepted Solutions

@jmwinters 

Hey there,  If I'm reading this correctly, I think you're missing an operator to combine your static and dynamic text.  Try this:

 

if(not(empty(body('Get_response_details')?['r66cdfa6620fa4db4b8fced24da5554de'])),concat('STATIC TEXT ', body('Get_response_details')?['r66cdfa6620fa4db4b8fced24da5554de']),'')

 

Keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @jmwinters ,

 

Following @edgonzales ’s suggestions, you could add Compose action and fill the response in Compose, so that we can directly determine whether the output of Compose is empty, like:

75.PNG

if(not(empty(outputs('Compose'))),concat('Text',outputs('Compose')),outputs('Compose'))

Feel free to let us know if you have any other questions.

 

Best Regards,

Community Support Team _ Barry
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

@jmwinters 

Hey there,  If I'm reading this correctly, I think you're missing an operator to combine your static and dynamic text.  Try this:

 

if(not(empty(body('Get_response_details')?['r66cdfa6620fa4db4b8fced24da5554de'])),concat('STATIC TEXT ', body('Get_response_details')?['r66cdfa6620fa4db4b8fced24da5554de']),'')

 

Keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

View solution in original post

v-bacao-msft
Community Support
Community Support

 

Hi @jmwinters ,

 

Following @edgonzales ’s suggestions, you could add Compose action and fill the response in Compose, so that we can directly determine whether the output of Compose is empty, like:

75.PNG

if(not(empty(outputs('Compose'))),concat('Text',outputs('Compose')),outputs('Compose'))

Feel free to let us know if you have any other questions.

 

Best Regards,

Community Support Team _ Barry
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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,449)