web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Coalesce can't get val...
Power Automate
Answered

Coalesce can't get value from MS Forms

(0) ShareShare
ReportReport
Posted on by 5
I have a MS Forms where the user choose year, and then get a dropdown menu where they choose name. In total there are five questions where the name can be chosen, but only one question can be answered per form (because of the previous chosen year leads to only one question). Four of the questions is therefore blank, and one have one name. The coalesce doesn't give any results ("value": null) even though I've checked there are data in one of the outputs. How can I make this work? I want the formula to check the five outputs, and give me the one that isn't blank.

I'm using this formula in a Set variable-box:
coalesce(outputs('Hent_svardetaljer')?['body/r6be04227351c4b8f9112dc937deb47f1'],outputs('Hent_svardetaljer')?['body/r074d0f9054e84a8e82704eec58dffc68'],outputs('Hent_svardetaljer')?['body/r07ef740bfdda41bfa66828ddc146566e'],outputs('Hent_svardetaljer')?['body/rb57d2aa0415c4334a70aab13caa9b1f4'],outputs('Hent_svardetaljer')?['body/r289529363b7e4874b8fcdc103fb92782'])
 
It gives this output when running the flow:
 
 
Thanks in advance for any help!
Categories:
I have the same question (0)
  • Fredrik_A Profile Picture
    3,570 Super User 2026 Season 1 on at
    Hey,
     
    could you please share a picture of a run you did where we can see that there is a value. 
     
    Most likely one or more of your dynamic values are wrongly mapped and might have changed ID if you replaced some of the questions. 
     
    If my response solved your issue, please mark it as ✅ Accepted Answer and give it a like.
  • Verified answer
    Inogic Profile Picture
    1,277 Moderator on at
    Hi,
     
    This happens because MS Forms doesn’t return true null values for unanswered questions. Instead, it usually sends an empty string ("").
    The coalesce() function only skips null values, not empty strings. So if the first field is empty ("") it still gets picked by coalesce, and that’s why you’re getting a blank result even though one of the other fields has a value.
    To fix this, you need to treat empty values as null before using coalesce. You can do that using empty().
    You can update your expression like this:
    coalesce(
      if(empty(outputs('Hent_svardetaljer')?['body/r6be04227351c4b8f9112dc937deb47f1']), null, outputs('Hent_svardetaljer')?['body/r6be04227351c4b8f9112dc937deb47f1']),
      if(empty(outputs('Hent_svardetaljer')?['body/r074d0f9054e84a8e82704eec58dffc68']), null, outputs('Hent_svardetaljer')?['body/r074d0f9054e84a8e82704eec58dffc68']),
      if(empty(outputs('Hent_svardetaljer')?['body/r07ef740bfdda41bfa66828ddc146566e']), null, outputs('Hent_svardetaljer')?['body/r07ef740bfdda41bfa66828ddc146566e']),
      if(empty(outputs('Hent_svardetaljer')?['body/rb57d2aa0415c4334a70aab13caa9b1f4']), null, outputs('Hent_svardetaljer')?['body/rb57d2aa0415c4334a70aab13caa9b1f4']),
      if(empty(outputs('Hent_svardetaljer')?['body/r289529363b7e4874b8fcdc103fb92782']), null, outputs('Hent_svardetaljer')?['body/r289529363b7e4874b8fcdc103fb92782'])
    )

    What this does is simple:
    • If a field is empty, it turns it into null
    • Then coalesce skips it and moves to the next one
    • Finally it returns the one field that actually has a value
    So the issue is not with coalesce, it’s just that the inputs are empty strings, not null.
    Hope this helps.
     
    Thanks!
    Inogic
  • DF-16031344-0 Profile Picture
    5 on at
    Thanks a lot, Inogic! Your solution worked.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard