Single Action button that affects multiple tables with multiple rows in one of the tables.

Here is my use case (as simply put as I can):

I have a table with job assignments for staff (Assignment Table):
WO_Number, Build_id, Date_assigned, Part_Number, Qty_to_Build, Complete, etc. etc. 

This table is being displayed with a "Start" button next to each assignment which creates a row in another table (Log Table):
Date, Start_time, Stop_Time, Complete, Employee, WO_Number, etc. etc. 

Multiple employees can "Start" a Work Order (WO) and likewise "Stop" a Work Order. But eventually, the WO will be complete so I want an Action that will mark TRUE in both the Assignment table and the Log table, On all of the lines where employees have recorded "Started" and "Stopped".  The intent of this action is to be able to Slice the Assignment table so that it will now "hide" the completed action, thus not allowing employees to "Start" a new line in the Log Table"

So I think this has two parts to this question. 
1. How do I create an action on a view that does not access the table that I am wanting to effect, (even though it does need the data to "lookup" which lines to effect on the Log table.
2. Can you please help me with the syntax of the equation to have it mark Complete on all of the rows on the Log table that share the same WO_Number. 

1 4 131
4 REPLIES 4

  1. The status: open/complete is an attribute of the Work Order, so it should exist in the Work Orders table, neither in the Assignment nor in the Log table. 
  2. WO columns in Assignement and Log tables should be of type Ref pointing towards the Work Orders table.
  3. You should create an action in the Work Orders table to set the WO status, and another action from another table with a WO Ref column that launches the first action on the row referenced by the WO column in the latter table. 

Please read the following guides:

Joseph_Seddik

Thank you for the comprehensive collection of guides. These are very helpful. 

So I have created a LucidChart of my tables so that I can see them all in one place and understand how they are relating to one another. I have added your suggestion to this in green so that you can see what I am hearing from you and we can make sure I am understanding what I am doing and why.

Screen Shot 2022-06-27 at 3.48.25 PM.png

What I think I hear you saying is that I need to create a 4th table that will only house the status of the WOs so that we don't have to populate this data across multiple tables. This seems super straightforward. My question is based on all of the other fields I am concerned that I will need to do this elsewhere and because of my inexperience, I am not seeing it. Further, it would possibly seem that the To_Build table might be able to satisfy, this as it is all static information to the App with the exception of the Completed column. 

Thank you so much for your time and help on this. 

Hello,

You should really study the first guide carefully and follow the links inside. It is of utmost importance that you have a correct data modelling upon which you'll build your app. When you setup your database correctly, everything becomes "straightforward" and easier afterwards. Then read the second guide so that you know how to relate your data together.

From your description, you should for example have at least the following tables:

  • Job assignment, its columns will you: which job/WO? with whom? when? etc.
  • Staff: Name, ID, incorporation date, rate/salary, etc.
  • Jobs/WOs: Client, Total Cost, Price, Date, Status, etc.
  • WO Details: Parts, quantity, etc.
  • Parts: Part number, name, cost, stock, etc.

After building your tables and establishing the corresponding references, you can then learn how to control the behavior of your app from the third guide. 

You should also read this to learn about AppSheet expressions:

Ok, thanks for your help. I will figure it out. 

Top Labels in this Space