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

Community site session details

Session Id : hCVdfAYI8hAuplnPo5DFD1
Power Automate - Building Flows
Unanswered

Problems with Expression to convert Forms text answer to a number

Like (0) ShareShare
ReportReport
Posted on 22 Feb 2021 15:36:42 by 24

Hi,

I am using Power Automate to copy Form responses to a SharePoint list

The problem I have is I need to to total up the answers, so 'Not al all' = 0 for example.

Should be easy, but I have got stuck with a problem with using an Expression to convert Forms answer to a number.

 

if(equals(<form field here>,'Not at all'),'0','error')
 
In fact with the forms choice is a Likert option, but I can easily get the text into an email or SharePoint list, so I am not sure why this is not working
This the with the forms data field in:
if(equals(outputs('Get_response_details')?['body/r020e7d0656574b7185a94dc9bab4d106'],'Not at all'),'0','error')
 
Any idea at all what obvious thing I am missing??
Thanks 
Ruth
 
  • RuthJennaway Profile Picture
    24 on 11 Mar 2021 at 17:24:14
    Re: Problems with Expression to convert Forms text answer to a number

    OK.
    The solution was simple after all.
    Copy and paste from other Power Automate If statements occasionally inserts non-standard space characters into the formula.

    So once I had retyped every text comparison by hand it worked fine.
    Grrr.
    OK, now I know!

  • RuthJennaway Profile Picture
    24 on 11 Mar 2021 at 17:21:30
    Re: Problems with Expression to convert Forms text answer to a number

    Hi ManishJain, thanks for your reply, I should have said the following :

    No Error in Power Automate, it runs fine, just always resolves to whatever value in put in the else clause.

     

    So 

    if(equals(*form field here*,'Not at all'),'0','error')

    results in error being written to the SharePoint field

    or

    if(equals(*form field here*,'Not at all'),'0','999')

    results in 999 being written to the SharePoint field

     

    The thing is a similar Form I did previously worked OK with these types of if statement, so I am at a loss!

    Regards

    Ruth

  • Paulie78 Profile Picture
    8,416 Moderator on 23 Feb 2021 at 11:25:43
    Re: Problems with Expression to convert Forms text answer to a number

    I would put a compose action before your if expression which just contains:

    outputs('Get_response_details')?['body/r020e7d0656574b7185a94dc9bab4d106']

    To determine what the value of it is, to see if it does actually match "Not at all" at the time of execution.

  • RuthJennaway Profile Picture
    24 on 23 Feb 2021 at 10:34:40
    Re: Problems with Expression to convert Forms text answer to a number

    Hi @ManishJain 

    thanks for your reply, I should have said.

    There was Error in Power Automate, it runs successfully, just always resolves to whatever value in put in the else clause. So I am trying to work out what is logically wrong with the If statement

     

    So 

    if(equals(<form field here>,'Not at all'),'0','error')   results in error being written to the SharePoint field

     or 

    if(equals(<form field here>,'Not at all'),'0','999')  results in 999 being written to the SharePoint field

     

    The thing is a similar Form I did previously worked OK with these types of if statement, so I am at a loss!

    Regards

    Ruth

  • MJain Profile Picture
    2,450 on 22 Feb 2021 at 16:11:35
    Re: Problems with Expression to convert Forms text answer to a number

    Hi @RuthJennaway ,

     

    What is the error you are getting while doing this ? 

     

    Thanks

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2