Having a hard time updating a row from another table.

Hello I have a mental block on this and have been struggling since last Thursday. I have a field service app that allows technicians to check into a work order(Work Orders table) when they arrive and check out when they leave. When checking in I have an action that creates a new row in a separate table(WOLaborCost) with tech info, time info, and GPS info. When Checking out I can easily do by going to a view of the Check in information and runing my "CheckOutData" action but I would like teh technicians to do this from the same work order using a " Check Out"  action. Using behavior I designate when "Check In" action or "Check Out" action is visible. I know I can modify my table and have a separate record for check in and check out, but then it will be harder to calculate time spent onsite since there are 2 different rows with the data.

Dat1GUI_0-1664860630792.png

The select statement to select the Checked in row in question selects using the work order number and additional criteria that the [DateTimeOut] field is blank indicating that a check in but no check out.

Select(WOLaborCost[Work Order], AND( [Work Order]=[_THISROW].[Work Order], ISBLANK([DateTimeOut])))

The reference action is CheckOutData(below) which I thought would update the row accordingly. Because I can run this action directly from the Check in view, I think I have an issue with selecting the appropriate row but for the life in me I cannot see what I am doing wrong. Any help would be appreciated.

Dat1GUI_1-1664861046824.png

WOLaborCost Table

Dat1GUI_2-1664861760480.png

Thank you for your precious time. 

Solved Solved
0 2 92
1 ACCEPTED SOLUTION

One error I immediately have noticed...

The expression in Referenced Rows must return key values. You should use WOLaborCost[id] instead of WOLaborCost[Work Order] as the first argument of the SELECT function.

See if this would fix your problem

View solution in original post

2 REPLIES 2

One error I immediately have noticed...

The expression in Referenced Rows must return key values. You should use WOLaborCost[id] instead of WOLaborCost[Work Order] as the first argument of the SELECT function.

See if this would fix your problem

Right on the dot, thank you so much works like a charm. Thank you TeeSee1 for your time.

Top Labels in this Space