cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
grazzhopper
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
faustocapellanj
Memorable Member
Memorable Member

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
faustocapellanj
Memorable Member
Memorable Member

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

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

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,280)