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

error handling - additional details

I have an SPO list with about 50 number fields. This is shared globally and there are some regions that use a comma for a separator and other that us a decimal. all users are force to enter numbers based on the setting of the site locale. Anyone outside the locale must reformat their input or it is rejected. Using power automate, and replicating the number fields, and making them text, now users can enter data in their regional locale and power automate will take that text and convert it to a float and write it to the number field.

Converting the original number fields to text will not work because there are external connections to these fields and I am not sure of the impact to the data or users. The owner did not want that risk. as long as users enter their numbers in the following format "1.2" or "1,2" there are no issues and works perfectly. That is the problem, because it is a text field they can enter anything they want. In the field settings I added custom validation that will check for special characters, but there is not way to add alpha to this formula because of the length of the formula. in power automate I added scope (try, catch, finally) an it handles the errors quite well.

The problem is the error details are lacking. The flow will bark on the the first input that is not a float, but I have no way of knowing which field without scanning all 50 fields. I would like to be able to send a message to the user that contains the column name and their input that failed, but I can't seem to figure out a solution. I thought about creating variables, that would mean 50 variables. I thought about trying the same logic that I use to convert the text to a float, but I am not sure what I am missing, it still errors. the following is my logic:

convert to float: if(not(equals(outputs('Get_item')?['body/OData__PalmiticAcid'],null)),float(replace(outputs('Get_item')?['body/OData__PalmiticAcid'],',','.')),null)   this will error if not a float, when it write to the number field.

 

try to get if error: if(not(equals(outputs('Get_item')?['body/OData__PalmiticAcid'],null)), if(not(float(replace(outputs('Get_item')?['body/OData__PalmiticAcid'],',','.'))),false,true), null)

 

this second one just fails. is there a way I can get the field details or the field that errors?

0 REPLIES 0

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (88,409)