cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
grazzhopper
Level: Powered On

[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

 

 

image.pngI 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
Super User
Super User

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!


3 REPLIES 3
Highlighted
Super User
Super User

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!


grazzhopper
Level: Powered On

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!

Super User
Super User

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 167 members 3,829 guests
Please welcome our newest community members: