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

Trigger Email when item in SP list had no updates in 1 min.

I'm having a difficult time finding out how to apply this logic. I'm stuck at triggering the email after 1 min. Your help would be very appreciated.

 

This is what I have from what I've seen on this site on time related topics:

 

@greaterOrEquals(formatdatetime(item()?['Last_x0020_Modified'],'yyyy-MM-ddThh:mm:ss'), addminutes(item()?['Modified'], +1,'yyyy-MM-ddThh:mm:ss')

 
InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2220': 'The template language function 'formatdatetime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.

 

3 REPLIES 3
Community Support
Community Support

Hi @cporras,

 

Could you please show a bit more about the input parameter (loop value) within your "Apply to each" action?

Could you please share a bit more about your Last Modified property?

Further, could you please share a bit more about your SharePoint list?

 

The error message told that there is something wrong with the formula that you provided within Condition box. The first parameter of formatDateTime() function is required to fill a timestamp string, but you provided a Null value. Please check if the following formula returns Null:

item()?['Last_x0020_Modified']

In addition, please check if the loop value within your "Apply to each" action contains the Last Modified property.

 

I have made a test on my side and I afraid that there is no way to achieve your needs in Microsoft Flow currently.

 

Best regards,

Kris

 

 

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks and apologies for the lack of information. I'm basically starting on this:

 

Could you please show a bit more about the input parameter (loop value) within your "Apply to each" action?

       Next Step Owner which is a Person with a valid email addres bsaed on Exchange.

       (This was added as loop by Flow when I added "Next Step Owner" to the "Send email" action "To:" field.)

 

Could you please share a bit more about your Last Modified property?

       The Last_x0020_Modified is a field I read worked better than the "Modified".

       The later would be updated by system changes vs the first which is only modifid end user updates.

 

Further, could you please share a bit more about your SharePoint list?

My sharepoint has 3 fields I'm interested in:" Status" which can be open/closed. "Modified" which is the built-in timestamp and "Next Step Owner" which is a Person with valid email based on exchange.

 

So my logic would be:

- When something is either created or updated a "Modified date" will be established.

- I want to flow to send the "Next Step Owner" an email each time one of his "Open" items have more than 60 min (1min for testing) without modification or closure.

- So I would compare the "modified date" vs a ("modified date" + 60min) and if this condition is true for an "Open" status item then send the email to the "Next Step Owner".

 

So far it is sending emails immediately, not after the 1min as Flow doesn't understand the logic.

Did you ever get anywhere on this? I am stuck on the same issue. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (13,107)