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
Solution Sage
Solution Sage

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!

Proud to be a Flownaut!


View solution in original post

3 REPLIES 3
Highlighted
Solution Sage
Solution Sage

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!

Proud to be a Flownaut!


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
Solution Sage
Solution Sage

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!

Proud to be a Flownaut!


Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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!

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