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.'.
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:
I hope this helps.
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.
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.