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 Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,878)