cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
YAMess
New Member

Expression - If for Compose + Join

I'm using compose and join to display optional answers from 2 questions in form but I can't get the flow to work if there is null (no answers).


I'm not to sure how to write the expression  - currently using contains but should i be using coalesce?

Compose.PNG

My expressions are as follows:

 

Compose1

if(contains(triggerOutputs('Get_response_details')?['body/r8d6acc68f2dd4b9fa1290c575d4cac19'], triggerOutputs('Get_response_details')?['body/re36471ebb5764466b7bc5c3392d10739'], null))

 

Join1

json(outputs('Compose1'))

 

Any help is appreciated 🙂

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @YAMess ,

 

Do you want to concatenate the answers to the two optional questions with two newline labels?

 

I have made a simple test for your reference.

if(empty(Question1),null,Question1)
if(empty(Question2),null,Question2])
if(or(empty(Question1),empty(Question2)),replace(outputs('Compose'),'</br></br>',''),outputs('Compose'))

vyujincuimsft_7-1658994508119.png

Result Screenshots:

vyujincuimsft_5-1658994176135.png

 

vyujincuimsft_4-1658994053838.png

 

vyujincuimsft_3-1658993992722.png

 

vyujincuimsft_6-1658994265791.png

 

 

Best Regards,
Charlie Choi

View solution in original post

1 REPLY 1
v-yujincui-msft
Community Support
Community Support

Hi @YAMess ,

 

Do you want to concatenate the answers to the two optional questions with two newline labels?

 

I have made a simple test for your reference.

if(empty(Question1),null,Question1)
if(empty(Question2),null,Question2])
if(or(empty(Question1),empty(Question2)),replace(outputs('Compose'),'</br></br>',''),outputs('Compose'))

vyujincuimsft_7-1658994508119.png

Result Screenshots:

vyujincuimsft_5-1658994176135.png

 

vyujincuimsft_4-1658994053838.png

 

vyujincuimsft_3-1658993992722.png

 

vyujincuimsft_6-1658994265791.png

 

 

Best Regards,
Charlie Choi

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.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,544)