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
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
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?
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 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?
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!
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
Proud to be a Flownaut!
User | Count |
---|---|
94 | |
39 | |
24 | |
22 | |
16 |
User | Count |
---|---|
128 | |
49 | |
48 | |
32 | |
24 |