cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Unity
Helper I
Helper I

Adding commas and decimals to currency: SharePoint Columns to Word Template

Hi all, 

 

I have a workflow that takes values from a SharePoint list and uses the values to populate a Microsoft word template, which then creates a word file.

 

In my SharePoint list, I have currency columns and a calculated column that adds the total of all the currency columns. 

 

My workflow goes like this:

1. User fills out Microsoft form

2. Results populate SharePoint list

3. Approval Workflow is triggered.

4. SharePoint list is updated.

5. SharePoint list populates Word Template.

6. Document/file is created from the template and saved.

 

Test 1 (on created word file):

Currency values have 2 decimal limit, but no comma: 13489.00

Total values have no decimal limit or commas: 14500.0000000000

 

Test 2 (on created word file):

 

I use the following solution here: https://powerusers.microsoft.com/t5/Building-Flows/decimal-place/td-p/50303

 

Currency values have 2 decimal limit, but no comma: 13489.00

Total values have 2 decimal limit, but no comma: 14500.00

 

Question:

 

Is there a solution for me to have both commas and decimals? These values populating word documents that are being used as contracts (for action, signing, etc) so the values need to be specific and easy to read. 

In my SharePoint list, there are no issues with comma or decimal placement, it's only when my workflow takes that same value and inputs it into my word template to create a file that the errors occur. I had expected that it would just display the same value as in my SharePoint list. 

I've created a few initiate/compose steps in my workflows just to create the decimal limit for each of my values, will I need to do so for the commas also? Is there a simpler way to do this? 

TIA

5 REPLIES 5
efialttes
Super User
Super User

Hi!

Did you consider using formatNumber() WDL expression or its equivalent FormatNumber action block? Not 100% it matches your expectations, but it is worth to try it. More info here:

https://flow.microsoft.com/en-us/blog/simplified-number-formatting/

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Thanks for the recommendation @efialttes 


It works for a standard currency column, but it doesn't work for a calculated column (which is the total of all currency columns). Any thoughts?

Unity_1-1600388614536.png

 

Unity_0-1600388556183.png

 

I've found a work around where when the item is created in sharepoint, I update the list after, putting the calculated field value into a separate non-calculated currency column. 


In that context, I can get the Format Number action to work properly. 

Would still prefer discovering a better/simpler way of doing it so there is less to maintain/fail.

@Unity 


@Unity wrote:

Thanks for the recommendation @efialttes 


It works for a standard currency column, but it doesn't work for a calculated column (which is the total of all currency columns). Any thoughts?

Unity_1-1600388614536.png

 

Unity_0-1600388556183.png

 


 

Hey Mate,

 

The Error message tells me that Expect First parameter to be integer but it got a String.

 

You can first convert the String to Integer(number) and then pass it is Format number

 

 

 

int(outputs('Compose'))

 

 

 

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

@Unity 

So you got a workaround? Excellent!

Now on your first approach, when assigning your calculated column as input for 'Format number', did you try to convert its type (currently string, according to the error you shared) into float by means of float() WDL expression?

Not with my laptop, unable to test

 

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,541)