cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
dkershner327
Level: Power Up

utcnow DateTimeStamp?

Hi there,

 

I have tried to use utcnow() to make simple timestamps in flow, and it doesn't appear to work like it does in logic apps or other places.  Can someone confirm that it does or doesn't work, or what people's workarounds are?

 

Thanks,

Derek

1 ACCEPTED SOLUTION

Accepted Solutions
dkershner327
Level: Power Up

Re: utcnow DateTimeStamp?

I re-read your post, and realized that you meant a condition that does nothing, but involves @utcnow().  I did this, and it doesn't seem to add anything to the dynamic content for me to use as a "Right now" timestamp while inserting to SQL underneath the condition.

View solution in original post

9 REPLIES 9
Community Support Team
Community Support Team

Re: utcnow DateTimeStamp?

Hi Derek,

 

 

This should be achievable if you create a condition and flip it to advanced mode. In the advanced mode, you can use the same expression syntax that Logic Apps uses. Expression reference is here: https://msdn.microsoft.com/en-us/library/mt643789.aspx

 

So, start by using the editor to do a basic comparison with the timestamp field, then switch to the advanced view. This will tell you how to reference the field you care about in the expression.

 

Regards,

Mona Li

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dkershner327
Level: Power Up

Re: utcnow DateTimeStamp?

I am new to Flow, but know Logic apps well.  I am using the SQL > Insert Row action, and I do not see any "advanced mode".  I would definitely leave this advanced mode flipped on all of the time if I can find it.

dkershner327
Level: Power Up

Re: utcnow DateTimeStamp?

I re-read your post, and realized that you meant a condition that does nothing, but involves @utcnow().  I did this, and it doesn't seem to add anything to the dynamic content for me to use as a "Right now" timestamp while inserting to SQL underneath the condition.

View solution in original post

dkershner327
Level: Power Up

Re: utcnow DateTimeStamp?

I found one potential workaround: grab the current time from http://www.timeapi.org/utc/now .  Since flow doesn't charge by the action, it should be fine, although inefficient.

 

If anyone has a better workaround, let me know.

patrickabel
Level: Powered On

Re: utcnow DateTimeStamp?

I had this exact problem yesterday and ended up using the http://www.timeapi.org/ as well.

 

good call dkershner327!

Abou
Level: Powered On

Re: utcnow DateTimeStamp?

http://www.timeapi.org/ Site is not working.

dkershner
Level: Power Up

Re: utcnow DateTimeStamp?

Correct you are, I think too many of us probably used it.

 

I now run a stored procedure in SQL for GETUTCDATE().  It's even less efficient, but will always work.

Abou
Level: Powered On

Re: utcnow DateTimeStamp?

Thank you for the tip.

How would you get that in Flow?

dkershner
Level: Power Up

Re: utcnow DateTimeStamp?

SQL > Execute Stored Procedure

 

For the procedure, you would just need something that either outputs the value into a table, and grab it that way, or as an output parameter to the procedure.

 

Something like:

 

CREATE PROCEDURE [dbo].[utcnow]
-- Add the parameters for the stored procedure here
@utcnow datetimeoffset(7) OUTPUT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here

SET @utcnow =(SELECT GETUTCDATE())


UPDATE [dbo].[getutcdate]
SET [timestamp]=@utcnow
WHERE [id]=1
END

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Users Online
Currently online: 177 members 4,581 guests
Please welcome our newest community members: