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

[Beginner] trying to get functions to work in a flow with compose

Hi,

 

Call me stupid, but I don't get the following simple flow to work. Beginner here with MS-Flows. Man Embarassed

 

  1. trigger every interval
  2. get the current (UTC) datetime 
  3. add two hours to it
  4. save it in a SQL database

 

 

I do something wrong here.I do something wrong here. 

 

I read that I need to get the output of Current Time area and use the functions in the Compose between quotes, but even with things like: "@addHours(Body()?['Current_time'],'2')" or variants I seem to miss the logic behind it.

 

If someone can help a beginner out I'd greatly appreaciate it!

 

Thnx,

Grazz.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: [Beginner] trying to get functions to work in a flow with compose

Hi @grazzhopper,

 

The way you want to approach the Compose step is by building the expression on the Expression panel. For example, when you select the Compose inputs field, the Dynamic content window will pop up on your right, and once there you can select the Expression tab. From there you can either start typing the function name, which in your case is addHours, and intellisense will give you suggestions as you type, or you can scroll down to the Date and time functions section and select the addHours() from
there.
addHours-1.JPG

 

After you select the addHours function, click inside the function's parenthesis and switch back to the Dynamic content tab. From there, select the Current time from the options below, and then add the number of hours you need. Click OK and save your flow. This is what your function will look like: 

addHours(body('Current_time'),2)

 addHours-2.JPG

 

Please let me know if you have any questions.

 

Regards,

Fausto Capellan, Jr

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

3 REPLIES 3
Highlighted
Memorable Member
Memorable Member

Re: [Beginner] trying to get functions to work in a flow with compose

Hi @grazzhopper,

 

The way you want to approach the Compose step is by building the expression on the Expression panel. For example, when you select the Compose inputs field, the Dynamic content window will pop up on your right, and once there you can select the Expression tab. From there you can either start typing the function name, which in your case is addHours, and intellisense will give you suggestions as you type, or you can scroll down to the Date and time functions section and select the addHours() from
there.
addHours-1.JPG

 

After you select the addHours function, click inside the function's parenthesis and switch back to the Dynamic content tab. From there, select the Current time from the options below, and then add the number of hours you need. Click OK and save your flow. This is what your function will look like: 

addHours(body('Current_time'),2)

 addHours-2.JPG

 

Please let me know if you have any questions.

 

Regards,

Fausto Capellan, Jr

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

View solution in original post

Highlighted
Frequent Visitor

Re: [Beginner] trying to get functions to work in a flow with compose

This was what I was missing! Thank you! Thank you! Thank you, @faustocapellanj!

Highlighted
Memorable Member
Memorable Member

Re: [Beginner] trying to get functions to work in a flow with compose

You're welcome @grazzhopper. I'm glad I was able to help.

Fausto Capellan, Jr
Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (6,833)