cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GoBucks
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
JoeF-MSFT
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. 

GoBucks
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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,489)