cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MartinBlack
Level: Powered On

Decimal Issue with "Populate a Microsoft Word template"

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:

Capture1.PNG

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.

Capture.PNGOn the Sharepoint list itself the three cols are displaying as I want, with no decimals:

Capture.PNG

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

10 REPLIES 10
Community Support Team
Community Support Team

Re: Decimal Issue with "Populate a Microsoft Word template"

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MartinBlack
Level: Powered On

Re: Decimal Issue with "Populate a Microsoft Word template"

Hi Barry, thanks for getting back to me.

Attached is my Flow set-up

 

flow.png

 

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

 

Community Support Team
Community Support Team

Re: Decimal Issue with "Populate a Microsoft Word template"

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.

21.PNG

 

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:

22.PNG

Expression reference:

string(int(triggerBody()?['rating']))

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MartinBlack
Level: Powered On

Re: Decimal Issue with "Populate a Microsoft Word template"

Hi Barry, thank you for responding and for your patience.

 

I tried step one as you described:

string.PNG

But when I run a test I get:

expression.PNG

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

Community Support Team
Community Support Team

Re: Decimal Issue with "Populate a Microsoft Word template"

Hi @MartinBlack ,

 

You can click on Dynamic content on your current configuration, then select the appropriate Dynamic content in Option and click on it.

22.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MartinBlack
Level: Powered On

Re: Decimal Issue with "Populate a Microsoft Word template"

Hi Barry

 

I followed your instructions

1.PNG

 

But am still getting an error message

2.PNG

Many thanks for all your help so far.

Community Support Team
Community Support Team

Re: Decimal Issue with "Populate a Microsoft Word template"

Hi @MartinBlack ,

 

Please do like this:

7890.gif

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MartinBlack
Level: Powered On

Re: Decimal Issue with "Populate a Microsoft Word template"

Hi Barry

 

Success!

compose.PNG

However, the decimals are still appearing in the Word doc.

 

Do I need to add anything at this stage?

populate.PNG

Once again, thank you for your patience!

MartinBlack
Level: Powered On

Re: Decimal Issue with "Populate a Microsoft Word template"

Hi @v-bacao-msft I'm still struggling with this, it would be wonderful if you could continue to offer advice.  Many thanks.

Community Support Team
Community Support Team

Re: Decimal Issue with "Populate a Microsoft Word template"

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:

69.PNG

Have you tried this method?

Hope it makes sense!

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (2,728)