Select to view content in your preferred language

Workflow to check if a survey has been submitted in the last week

49
1
Friday
RemyOlive
Occasional Contributor

Hi everyone,

I'm looking at building an automated workflow to check if a survey has been submitted in the last week, and if not, to send a notification to a manager.

I have most of the flow working, which looks like this so far: 

RemyOlive_0-1732884655839.png

The idea is to just get the layer's data, and compare the last survey's date with today's date to see if more than 5 days have passed since the last survey submission.

My problem is that the "Get data from feature layer" action outputs a JSON that has all the feature layer's records in it, and I can't seem to figure out how to only get it to output the last submitted record.
I tried using the WHERE clause in the action, but it seems that the MAX function doesn't work here (or I wrote it wrong).

Does anyone have an idea on how to filter the records to only get the most recent record/the record with the highest date ?

It would help me a lot, 

Thanks all,

Rémy

0 Kudos
1 Reply
ChristopherCounsell
MVP Regular Contributor

where=1=1

outFields=*

orderByFields=your_date_field DESC

resultRecordCount=1

This gives one feature sorted by date field.

0 Kudos