cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
citykidz
Frequent Visitor

Initialize a variable fails with value of float

I am building a flow that runs when someone adds an attachment to an item in a Sharepoint list.  I have to specify which item; in this case the row number is called 'ReqID'; it's a column in Sharepoint that's type is "Number".  I initialized the variable in PowerAutomate  because I need to reference it in the content of an Adaptive Card.   PowerAutomate threw an error and told me this was a new issue and I should post it here:


Error:
Action 'Initialize_variable' failed


Error details:
Bad Request. The variable 'ReqID' of type 'Integer' cannot be initialized or updated with value of type 'Float'. The variable 'ReqID' only supports values of types 'Integer'.


I guess I need to figure out a way of converting a floating point value to an integer so Power Automate doesn't barf.

 

Here's a screen shot of my flow, if you need it:

Screenshot 2021-12-01 110854.png


Please advise. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @citykidz 

 

Try using the below expression. Store the value in a variable float and in your next compose action step use the below expression

 

first(split(string(variables('Float')),'.'))

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

2 REPLIES 2
abm
Super User
Super User

Hi @citykidz 

 

Try using the below expression. Store the value in a variable float and in your next compose action step use the below expression

 

first(split(string(variables('Float')),'.'))

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
VictorIvanidze
Community Champion
Community Champion

Use int() function: https://powerusers.microsoft.com/t5/Building-Flows/int-function-not-working-as-expected/td-p/418008

--------------------------------------------------------------------------------------
Contact me if you are interested in custom Power Automate development.

Helpful resources

Announcements
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.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,980)