cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Mapping List Calculated Column Value to Word Template

I'm building a flow to take a List item's values, map them to a Microsoft Word template, and save it as a proposal document.  Initially, I ran into issues with formatting the calculated values correctly as currency in the Word template, but I found how to Compose the value as an integer and format it appropriately, as shown in the screenshot below:
Compose function - int(triggerBody()?['CalculatedColumn'])

 

simpkinspete_0-1614893472235.png

 

Now I'm running into issues with two values that are unable to be converted to integers.  

 

"Unable to process template language expressions in action 'Compose' inputs at line '1' and column '3042': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'."

 

simpkinspete_1-1614893843235.png

 

Does anyone have suggestions on what I should try next? 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

Then you want something like:

formatNumber(float(outputs('Compose_2')), 'C2')

View solution in original post

9 REPLIES 9
Paulie78
Super User
Super User

You need to find out what the value was that it could not convert. You could put a compose before that compose that just has the value that you are trying to put into the int function. Then we can tell you how to fix it.

Anonymous
Not applicable

Do you need the raw inputs/outputs? 

 

simpkinspete_0-1614894533552.png

 

Anonymous
Not applicable

simpkinspete_0-1614894782629.png

 

Paulie78
Super User
Super User

Well, you can't convert it to an int because it does not represent an int. You could use float() or formatNumber function. What value do you want to go into Word? instead of 18.66675000000...

Anonymous
Not applicable

I'd love to format it as currency and rounded to the nearest cent, $18.67.

Paulie78
Super User
Super User

Then you want something like:

formatNumber(float(outputs('Compose_2')), 'C2')
Anonymous
Not applicable

That worked perfectly.  I'm going to go back and update my previous Compose steps to consolidate the formatting steps. Thanks for your help!

 

All of my calculated columns in SharePoint are formatted the same way.  Do you have any ideas why my other values could be formatted as integers but not these? 

Paulie78
Super User
Super User

I'm not sure I understand the question, in this example it was because the number 18.66675000000 cannot be represented as an integer. Because it has numbers after the decimal point, integers can be made from whole numbers only such as "18". Did I misunderstand the question?

Anonymous
Not applicable

No, that makes sense.

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.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,367)