cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

When to use use {Compose:input ['Number Column']} vs "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column'])

I am working on getting an excel table from a SPO library to SPO DataList. While working on the flow I noticed that most of the solution in the community forum falls into the use of @float(outputs('Compose'))" vs @float(triggerbody()?['Number Column']) when I searchd for Numeric Feild for SPO flow.

 

I was NOT able to get my flow working @float(outputs('Compose'))" vs @float(triggerbody()?['Number Column']) as I always get InvalidTemplate error probably my syntax is wrong. However I was able to get my flow working by using Input/Output.


ComposeP1.pngComposeP2.png

 

Question is when do I use "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column']) and when do I declare a floating variable? is my solution optimal?

1 ACCEPTED SOLUTION

Accepted Solutions
v-zhos-msft Solution Sage
Solution Sage

Re: When to use use {Compose:input ['Number Column']} vs "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column'])

Hi @yellowsubmarine ,

What the column name of the two columns in your excel file.

For example, in my excel, the column name is Column1, So the expression is :

float(items('Apply_to_each')?['Column1'])

Capture15.PNG

For you flow, you just need change the expression with the column name of yours.

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

6 REPLIES 6
v-zhos-msft Solution Sage
Solution Sage

Re: When to use use {Compose:input ['Number Column']} vs "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column'])

Hi @yellowsubmarine ,

When you get the number from the excel file to flow, the type of the value will change to string.

The type of Input/Output is string.

When you want to change the data format, you need to use the function of @float().

I have made a test below: the type of column1 in excel is number.

Capture10.PNGCapture13.PNGCapture9.PNGCapture12.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Highlighted

Re: When to use use {Compose:input ['Number Column']} vs "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column'])

Hi @v-zhos-msft 

 

Thanks for the respone, Could you share the expression you used for the float?

 

@v-zhos-msft does that mean even if I was able to call the value from input(excel data table) to output SPO number format columns Amount1 and Amount2 the values are transferred as string?

 

best regards,

ys

v-zhos-msft Solution Sage
Solution Sage

Re: When to use use {Compose:input ['Number Column']} vs "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column'])

Hi @yellowsubmarine ,

The expression is: float(items('Apply_to_each')?['Column1'])

Capture14.PNG

For the second question, when you transferred the data via flow, the value type will change to string.

 

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Re: When to use use {Compose:input ['Number Column']} vs "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column'])

Hi @v-zhos-msft ,

 

Based on my flow from excel to SPO Data list what should be my dynamic expression solution to convert it to float number format to the 2 columns I have formatted as number.

 

Should a varaible be declared first? When would be the use case to use a float(triggerboddy)? expression?

 

best regards,

ys

v-zhos-msft Solution Sage
Solution Sage

Re: When to use use {Compose:input ['Number Column']} vs "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column'])

Hi @yellowsubmarine ,

What the column name of the two columns in your excel file.

For example, in my excel, the column name is Column1, So the expression is :

float(items('Apply_to_each')?['Column1'])

Capture15.PNG

For you flow, you just need change the expression with the column name of yours.

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Re: When to use use {Compose:input ['Number Column']} vs "@float(outputs('Compose'))" vs @float(triggerbody()?['Number Column'])

@v-zhos-msft thanks for the clarification. I might raise another question regarding triggerbody as my question is pretty general. 🙂

 

best regards,

ys

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,228)