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

Format AI Builder 'Object' as decimal?

Hi everyone.  First post here and hopeful you can help.  I am building my first flow and using AI Builder to extract invoice data and enter into my accounting software.  The last hurdle I have is getting the '$' dropped from the currency value so that it can be properly input.  I tried using FormatNumber  but get the following error, which I do not know how to resolve even after reviewing these forums.  Bottom line - How do I format an 'Object' from the Forms Processing AI as an integer?

 

Unable to process template language expressions for action 'Format_number' at line '1' and column '33723': 'The template language function 'formatNumber' expects its first parameter to be an integer or a decimal number. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#FormatNumber for usage details.'.

 

 

3 REPLIES 3
Power Apps
Power Apps

Hi @GoBucks,

 

Thanks for posting the question.

You will need to remove the $ sign from the value. You will need to first use the replace expression to remove it and then float to convert it to a number like this. Here is an example:

float(replace(outputs('Process_and_save_information_from_forms')?['body/responsev2/predictionOutput/labels/Total/value'],'$',''))

You will need to replace the value in blue, by your value like this:

ForumPA.gif

I hope this helps. 

New Member

thank you so much for the reply.  I did as you suggest, but now get a new error:

Unable to process template language expressions in action 'Enter_Invoice_Data' inputs at line '1' and column '33488': 'The template language function 'float' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

 

This is the verbatim function and flow.  Really appreciate your time and expertise.

 

float(replace(outputs('Process_and_save_information_from_forms')?['body/responsev2/predictionOutput/labels/TOTAL/value'],'$',''))
 
FlowError2.png

Hi @GoBucks,

 

There might not have a need to do a conversion to float. Just keep replace(outputs('Process_and_save_information_from_forms')?['body/responsev2/predictionOutput/labels/TOTAL/value'],'$','') without the float function. 

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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!

Top Solution Authors
Top Kudoed Authors
Users online (5,775)