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.
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
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.
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
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!