Hi all, Flow beginner here.
I've succesfully set up a Flow that sends data from a Sharepoint list to a Word template that then creates a Word doc on OneDrive.
However, my issue is that three of the fields in the Word doc are displaying unwanted decimals. See attached screen grab of the Word doc:
The three columns on the Sharepoint listed are 'Calculated (calculation based on other columns)'
I have tried all the decimal settings but none make any difference.
On the Sharepoint list itself the three cols are displaying as I want, with no decimals:
How do I get rid of the decimals on the Word doc? Is this something I have to set up in the Word template or on the Sharepoint list?
Many thanks
Martin
Hi @MartinBlack ,
Could you provide screenshoot of Flow configuration?
From the screenshots you provided, it seems that some settings have been made in Word Template, asking how many digits the number contains.
You could use Compose to output these values in Flow to see if they also contain decimals.
You could also try to use int() function to remove the decimals in Flow, then use string() function to convert them to a string, and finally insert it into Word template.
Best Regards,
Hi Barry, thanks for getting back to me.
Attached is my Flow set-up
What is 'Compose'?
"You could also try to use int() function to remove the decimals in Flow, then use string() function to convert them to a string, and finally insert it into Word template."
Where in Flow would I do this? Is it a new step?
Many thanks
Hi @MartinBlack ,
I mean, you can configure the field value in Compose. After the Flow is executed, check the format of the field value here.
Included in Compose and Body of Populate a Microsoft Word template action.
In addition, the expression I mentioned is expected to directly convert the type of the field value to string, which does not seem to be bothered by the decimal.
Like:
Expression reference:
string(int(triggerBody()?['rating']))
Best Regards,
Hi Barry, thank you for responding and for your patience.
I tried step one as you described:
But when I run a test I get:
From the error message: " 'int' expects one parameter: the value that is to be converted to an integer."
What parameter (value) do I need to add to the expression?
Many thanks
Martin
Hi @MartinBlack ,
You can click on Dynamic content on your current configuration, then select the appropriate Dynamic content in Option and click on it.
Best Regards,
Hi Barry
I followed your instructions
But am still getting an error message
Many thanks for all your help so far.
Hi @MartinBlack ,
Please do like this:
Best Regards,
Hi Barry
Success!
However, the decimals are still appearing in the Word doc.
Do I need to add anything at this stage?
Once again, thank you for your patience!
Hi @v-bacao-msft I'm still struggling with this, it would be wonderful if you could continue to offer advice. Many thanks.
Hi @MartinBlack ,
Could you share your current configuration?
The method I recommend you to use is to place the field value in Compose and then use the output of Compose to configure the fields in the word template.
If you need to configure multiple fields, you need to configure multiple similar Composes.
Like:
Have you tried this method?
Hope it makes sense!
Best Regards,
User | Count |
---|---|
38 | |
36 | |
17 | |
14 | |
12 |
User | Count |
---|---|
26 | |
20 | |
19 | |
13 | |
13 |