0

I am using a calculated column (currency) in a SharePoint list, and putting the value into an email using a Power Automate Flow. The value will always be a dollar amount.

When the value is passed through to Flow, it's converted to a string with a decimal point and several zero's added, so $5,416.52 (in SharePoint) becomes 5416.52000000000 in the Power Automate E-mail.

I have been able to use the below line to resolve my integer problem for non-currency fields.

formatNumber(int(outputs('')?['body/']), '0', 'en-us')

Now I'm trying to do the same thing as above but with Currency. Any assistance would be greatly appreciated! I have multiple calculated currency fields in the SharePoint list that I need to copy over. So an Expression would be the best route forward.

Thanks for your assistance!

2 Answers 2

1

You could use [Format number] action to format SharePoint values in Power Automate

enter image description here

Output

enter image description here

Updating this post for SharePoint Calculated Column

1) SharePoint Columns a) Single line of text b) Calculated column, output as Single line of text

enter image description here

2) Power Automate

enter image description here

Expressions used

1) outputs('Get_items')?['body/value']?[0]?['ColSingleLine']

2) outputs('Get_items')?['body/value']?[0]?['calculatedSingleLine']

3) float(variables('varCalculatedSingleLine'))

4) float(variables('varColSingleLine'))

Final Output enter image description here

5
  • I tried using the steps that you demostrated above but still received the trailing zero's. For the Value on the "Initialize Variable" I selected the field that I'm trying to import from the SharePoint calculated column. I have also tried to change the output of the calculated column to "Single Line of Text", Number or Currency and all fail. Thanks for the help!
    – Eric_D
    Apr 22, 2021 at 19:26
  • Let me test this out with values from SharePoint - will update the post accordingly Apr 22, 2021 at 20:31
  • [Format Number] action expects a [Number] value, so did you convert the SP field's value by using float() as shown in my example? Apr 22, 2021 at 20:33
  • You must be doing something differently when accessing SharePoint Fields. I've just tested with SPO fields, with a [Single line of text] and a [Calculated] column output as Single line text. In my flow I used variables to capture values from the item and then convert to float before formatting using [Format Number]. I can post my solution, if you need it Apr 22, 2021 at 21:13
  • Just posted my response with [calculated] column. Let me know if you still see any issues. Or post your Power Automate for further troubleshooting Apr 22, 2021 at 21:57
0

Thank you for all of your assistance. You definitely pointed me in the right direction. Here is what I did to successfully convert my calculated fields.

SharePoint Calculated Column Configuration

SharePoint Calculated Column Setup

Flow Configuration

Flow Configurations

float(variables('var_Travel_Total'))

Final Output

Final Output

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.