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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

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