Select to view content in your preferred language

Conditional visibility of field in form based on last date in table

349
2
06-09-2023 07:15 AM
mikAMD
by
Occasional Contributor III

I'm setting up a form in Field Maps where some fields only need to be filled once a month or twice a year (spring and fall) or once a year (after a certain date).

I wish to show or hide the fields based on the last inspection date. For example, if a field needs to be filled once per month but the inspection was already checked for the current month, then hide the field.

I already posted a question in regards to this and I thought I would be able to find a workaround but I can't seem to find anything!

Any suggestions?

Thanks! 

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor

You can get the Month value for the last inspection data and compare it to today's Month value. If they're the same, the field is hidden. To be safe, you'll also want to make sure the Year value is the same

Month($feature.LASTUPDATE) == Month(Now()) && Year($feature.LASTUPDATE) == Year(Now())

 

0 Kudos
mikAMD
by
Occasional Contributor III

From what I understand, "$feature" gets info on the current row/form being entered. Meaning I can't get the last updated date (previous row) with this function. Maybe I misunderstood how $feature works?

Or I would need somehow to calulate a field beforehand to get the last updated date, but I don't think this can be done on AGOL alone?

0 Kudos