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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issue differentiating ...
Power Automate
Unanswered

Issue differentiating between null and zero NPS score results

(0) ShareShare
ReportReport
Posted on by 9

Hoping someone can help with the following scenario:

 

We have a Forms form containing a few NPS type questions. We use branching to make one of the NPS questions only appear if the previous question result is Yes. I take the form responses into a SharePoint list using a Power Automate Flow and store the NPS results in a number column in SharePoint.

 

The issue I have is that if the branching causes the optional NPS question to be omitted, I need to return a blank value into the SharePoint list (as opposed to a zero value indicating the question has been answered but the user filled in a rating of zero).

 

It seems that flow returns the results correctly....

This is where the question 'How likely are you...' was omitted:

alexlush_severn_0-1697716756157.png

And this is what is returned if the user rates us as a zero:

alexlush_severn_1-1697716929896.png

Trying to use:

 

 

int(outputs('Get_response_details')?['body/rd4c5590be4854ee78e742aaa6b920e18'])

 

 

 Fails when the question has been omitted, I assume because int('') will fail.

 

The only way round this I have found so far is to use a Condition on the result of the previous question to detect if to expect an answer, and do two separate 'Create Item' actions, one with the NPS question and one without.

 

Like this...

alexlush_severn_3-1697717696829.png

 

Is there a more elegant way to do this, my flow is quite complex already so i could do without another condition being added if possible!

Categories:
I have the same question (0)
  • Verified answer
    wskinnermctc Profile Picture
    6,519 Moderator on at

    You can try to check if the response has a present answer using the empty() function with an if() check. It is basically like the condition you used, except in the expression.

    Reference Guide for Expression Functions 

     

    The only thing I'm not certain is the output to sharepoint. Like you can try '' for a blank or even null so see what works.

    if(empty(outputs('Get_response_details')?['body/rd4c5590be4854ee78e742aaa6b920e18']),'',int(outputs('Get_response_details')?['body/rd4c5590be4854ee78e742aaa6b920e18']))

    or

    if(empty(outputs('Get_response_details')?['body/rd4c5590be4854ee78e742aaa6b920e18']),null,int(outputs('Get_response_details')?['body/rd4c5590be4854ee78e742aaa6b920e18']))

     

  • alexlush_severn Profile Picture
    9 on at

    @wskinnermctc - thanks so much i think the empty() function was what ! was missing!

  • alexlush_severn Profile Picture
    9 on at

    Just for completeness, the second of the two proposed answers worked:

    if(empty(outputs('Get_response_details')?['body/rd4c5590be4854ee78e742aaa6b920e18']),null,int(outputs('Get_response_details')?['body/rd4c5590be4854ee78e742aaa6b920e18']))

     The first failed as the value '' was not a permitted integer value as the SP column needed an integer between 0 and 10. Null was accepted as a value however.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard