Copy row and reset data

need to create an action that will copy record/row, then do all the following:
reset checked in to NO
clear checked in timestamp
clear room assignment
clear caregiver present or reset to NO
reset service animal present to NO
reset MDP family to 0
reset MDP pets present to 0
reset checked out to NO
clear checked out timestamp
open to new check in form (that has been cleared/reset)

Is it just a matter of creating a bunch of individual actions and then doing a grouped action?

I did try a smaller set of the above with the last action being the โ€œcheck in formโ€ but it didnโ€™t open to the form.

0 13 1,650
13 REPLIES 13

Perhaps thereโ€™s an easier way: whatโ€™s the initial value for each of those columns? Sounds to me like youโ€™re only trying to set a few columns worth of data, passing them forward (if you will).

You might try LINKTOFORM() where you pass along the info you want. Like:

LINKTOFORM(โ€œCheck in formโ€,
โ€œNameโ€, [_thisrow].[Name],
โ€œSpecific notesโ€, [_thisrow].[Specific Notes],
)

etc.

The idea here being you open the new form and pass along only the info you want.

I think it needs to be a copy row though.

The situation presented to me was that people come to an evacuation center and may leave so they are checked in and checked out at this point. Storm gets worse so they come back. We want to retain the previous check in/out data and create a new row/record to capture the new check in/out.

After hurricane season I will be looking at just having a separate table that is linked to the main record but I donโ€™t have time to work on that now.

But if youโ€™re creating a copy, then clearing all the time data, itโ€™s not really a copy - youโ€™re passing long identity information.

I think LINKTOFORM() is what you want because it gives you the ability to selectively copy values over, you just have to specify which ones when building the formula.

For each column that you want to stay the same, create a pair of statements inside the LINKTOFORM() formula.


If you wanted to go the route of using the copy action, then what you would need to do is create some way of differentiating between the first and a copy, then use that to trigger the action stack like you were thinking.

You could create each of those actions separately, then create a group and assign that group to run when you save the check in form. But you have to put a condition on the stack so that it only runs and clears things when youโ€™re creating a copy - but you have to have some way of telling the system that.

Also, the order of these operations would be:

  1. create copy (open form)
  2. save copy (save form)
  3. action stack to modify everything so itโ€™s reset.

In your scenario, I would use linktoform to populate the identity information (and any other relevant info) into the form for the re-admission.

If using the linktoform how would we retain all the check in/out data if they come and go multiple times? Would it be linking to a form in a separate table just for check in/out?

We have a ton of calculations happening in the database as well that Iโ€™m worried about screwing up.

Trying to count actual bodies in the evacuation center (based on checked in but not checked out), and then overall totals for the event (based on checked in AND checked out). I need some way to keep track if John Doe comes and goes then comes back. I never knew this was a thing in an emergency evacuation but apparently it happens often enough I need a solution.

I agree with @MultiTech_Visions.

Iโ€™m still confused on how I would be capturing new check in information and not just overriding the old info if I use to Linktoform to the same row in the table. What am I missing ?

Because when you use link to form, your creating a new row not editing an old one. So every time that somebody would push the button for a new check in, that is actually saving a new record in the check-in table.

this way youโ€™ll have multiple records in your check-in table, each one accounting for when somebody came in.

@MultiTech_Visions Iโ€™m working on this but when I click the action button I just get a blank page - see attached. Where did I go wrong?

Is that a space after the โ€œInโ€ ???

2X_f_f0e3006d294dcd780017b131186a660a3129c177.png

Good eye! The form now comes up but none of the info filled in - name, organizationโ€ฆ itโ€™s just a blank form.

Maybe try removing the [_thisrow]. from the column references
2X_d_d9a664aceeb1e86ed48fda3f268545b43cc1ef6f.png

That worked - thank you. I never know when to use _thisrowโ€ฆ

Generally speaking the time to use this is when youโ€™ve got a formula thatโ€™s in a different context than where it is, like SELECT() formulas; when you say SELECT(Users[UserID], true, true) youโ€™re telling appsheet to jump into the โ€œUsersโ€ table context, so to tell the system โ€œI need to go back to the โ€˜originโ€™ context (the table where the formula is being used)โ€ you include [_thisrow].

So any formula where youโ€™re getting stuff from another table:

  • lookup
  • select
  • filter
  • etc.

In workflows though it takes on a more specific control, with the ability to go [_thisrow-1] and such to delve deeper in the layers of your data.

Top Labels in this Space