Select to view content in your preferred language

Copy Inspection Record, Clear Selected Fields

466
3
11-30-2023 09:12 AM
DNVT
by
Occasional Contributor

I have a Feature Layer with a related Inspection Table. Within Field Maps we have the ability to create a new record in the Inspection Table or copy a previous record and update. Within the Inspection Table there is an "Inspector" and "Inspection Date" field. When executing the Copy function I would like the "Inspector" and "Inspection Date" field to be null at Copy, forcing the inspector to input new information. Any thoughts?

0 Kudos
3 Replies
BrianBulla
Honored Contributor

I think if you create an arcade expression to autopopulate both the Inspector field and the Date field, it will NOT carry over those two field, and the rest will just copy over as per usual.

In my limited testing, this is what I am seeing....the date is definitely updating, and I'm pretty sure the Inspector would be too, but all of these records have my name for all my test data, so can't say for sure.

In Arcade use "return Now()" for the date.

For the Inspector Name there are a few options, but if you just want their logged in username something like this will work, using whatever the layer name you are using in your app.

GetUser(FeatureSetByName($datastore, 'Hydrants')).username;
0 Kudos
DNVT
by
Occasional Contributor

@BrianBulla Thanks! Yeah, that does work as a solution, but to further my issue, the date of inspection might not be now. The inspection could be from a previous date and the inspector just now getting around to updating the data on the device. Also, our usernames are assigned to individual devices, and not to an individual that is using the device. This would populate the inspection with the username logged into the device, and not the actual inspector that is using the device. I might just use this solution as a holdover but would love a solution that clears the field and allows the user to input or override the auto populated/arcade expression input.

0 Kudos
BrianBulla
Honored Contributor

Yeah, it seems like once you use a calculated expression, there is no way to 'overwrite' it in the form....which is a bit of a bummer.

0 Kudos