cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Power Apps
Power Apps

Re: Format AI Builder 'Object' as decimal?

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. 

Highlighted
New Member

Re: Format AI Builder 'Object' as decimal?

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
Highlighted
Power Apps
Power Apps

Re: Format AI Builder 'Object' as decimal?

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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,042)