Verify User on Last Record with Current Submission

Verify User on Last Record with Current Submission

Not sure if this is possible, as I am not sure when the Added User field can be verified during submission or after.

I am attempting to make sure the user who is submitting form is the same person that was on the last Record. I have it set up that fields will auto populate to the new form from the users last form. But will multiple users I would like to make sure they are getting information from the correct fetched form.

Getting stuck on the "If" statements (not sure if that is what I need to do.)


LastRec = SurveyT[ID !=0] sort by Added_Time desc;
if ( LastRec.Added_User == input.Added_User ){

Action would be to submit form
}
      else{
            Alert"Please Verify Location
            }

Very new to all this so any help would be appreciated.