Select to view content in your preferred language

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

164
3
11-29-2024 04:55 AM
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
3 Replies
ChristopherCounsell
MVP Regular Contributor

where=1=1

outFields=*

orderByFields=your_date_field DESC

resultRecordCount=1

This gives one feature sorted by date field.

RemyOlive
Occasional Contributor

Hi Christopher,

Thanks for your reply, but I can't get this to work on my flow, 
Where do you apply this filtering ? I don't find the "orderByFields" or "resultRecordCount" on the workflow action:

RemyOlive_0-1733144302942.png

Do I need to add in another action to filter through the results of the "Get data from layer" action ? If yes, which action would allow this ?

Thanks a lot,

Rémy

0 Kudos
RemyOlive
Occasional Contributor

Hi again everyone,

Trying to push this back up as I still don't understand whether this is possible or not,

Thanks,

Rémy

0 Kudos