Trouble with reference expressions

Hey guys! I've been stuck with this for a couple of days, so I could use some help.

I am building a simple app to check dogs in and out of a playground. I have a parent table called "customer information" with a record for each dog, with both dog's and owner's information, and it contains a field called "status" that can be either "checked in" or "checked out".

Then I have the child table called "Activity" which I want to use as a log to calculate how long they stayed in the playground in order to invoice. 

My CHECK IN view is based on a data slice that filters those in parent table whose status is "checked out" so I can select one dog, and from the detail view I can run an action that triggers two other actions. One of them changes status in parent table to "checked in", and the other one creates a record in the child table, copying the dog's full name from parent table, which is a key field, and time stamps the check in field in child table.

The problem I have is with the CHECK OUT view.  If I use a data slice from the parent table, filtering only those whose status is "checked in", then I can change status to "checked out" in parent table but I can't timestamp "check out" field in child table. And if I use a data slice from child table, filtering only those whose "check out" field is blank, then I can time stamp that field, but I can't change status to "checked out" in parent table.

I know there should be a way to use some referencing, but I can't seem to be able to work around it.

I would really appreciate some help. THANKS!!!

0 2 43
2 REPLIES 2

If you use a data slice from the parent table then you can have an action run on edit when [_thisRow_Before].[Status]<>[_thisRow_after].[Status]. The action can then update the row in the child by using SELECT(Activity[check out],AND([dogs full name]=[_thisRow].[dogs full name],ISBLANK([check out]))) in your action

Or if you use a data slice from child table, you can have an action run on edit when AND(ISBLANK([_thisRow_Before].[checked out]),ISNOTBLANK([_thisRow_after].[checked out])). The action can then update the row in the parent by using SELECT(customer information[checked out],[dogs full name]=[_thisRow].[dogs full name]) in your action

Thanks a lot for your explanation @lynchk21 !!!!. I will try it latter when I get home.

Top Labels in this Space