cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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

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
Community Support

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.

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.

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

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.

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

 

good call dkershner327!

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

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.

Thank you for the tip.

How would you get that in Flow?

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (5,554)