cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anthonys123
Helper IV
Helper IV

What's the syntax to combine strings in IF Else?

Form includes FIRST and LAST. 

If FIRST is empty, then LAST. 

If FIRST is not empty, then LAST, FIRST. 

 

if(empty(triggerbody()?['text']?['Value']),triggerbody()?['text_1']?['Value'],????)  

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Like this:

 

if
(
  empty(outputs('Name')['first']),
  outputs('Name')['last'],
  concat(outputs('Name')['last'],', ',outputs('Name')['first'] )
)

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

View solution in original post

2 REPLIES 2
Paulie78
Super User
Super User

Like this:

 

if
(
  empty(outputs('Name')['first']),
  outputs('Name')['last'],
  concat(outputs('Name')['last'],', ',outputs('Name')['first'] )
)

 

Blog: tachytelic.net

YouTube: https://www.youtube.com/c/PaulieM/videos

If I answered your question, please accept it as a solution 😘

Fantastic! I had a couple things wrong. I think I had tried concat but did concat(thing),(thing),(thing). I was also using triggerbody()?['text']?['Value'] because I found an example elsewhere and for me it was saving me from errors. Both of these make zero sense now that you've cleared it up for me. Thank you! 

 

Final: 

if(empty(triggerBody()?['text']),triggerBody()['text_1'],concat(triggerBody()['text_1'],', ',triggerBody()?['text']))

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,328)