Hello @gio and Tulip Community,
I would like to create an app where , if a part is found defective in the “table of parts”, I would like to move this part’s serial no. into another table called the “Defective parts table” and the new part no. will be entered into its place in the “Table of parts”.
Will I be able perform this in Tulip ? I tried Linking the tables and also tried giving the command “Table Records - create or Load record” but these haven’t given me the expected result.
Yes, you can create an app in Tulip that moves a part’s serial number from the “Table of parts” to the “Defective parts table” and replaces it with a new part number in the “Table of parts”. [One way to achieve this is by using Linked Records in Tulip Linking Table Records. Here are the steps to do this:
- Create a new column in the “Table of parts” called “Defective” and set the field type to “Boolean”.
- Create a new column in the “Defective parts table” called “Serial Number” and set the field type to “Text”.
- Link the two tables using Linked Records. To do this, add a new column in one of the tables and select “Field Type: Linked Record”. A modal will pop up where you can select the other table and the field to link to.
- Create a trigger that fires when a part is found defective in the “Table of parts”. This trigger should update the “Defective” column to “True” for the defective part and create a new record in the “Defective parts table” with the serial number of the defective part.
- Create a second trigger that fires when a new part is entered into the “Table of parts”. This trigger should check if there are any defective parts in the “Table of parts” and replace the serial number of the first defective part it finds with the serial number of the new part. It should also update the “Defective” column to “False” for the defective part.
I hope this helps!
Another way to do this is through automations.
- Identify a specific table record in your “table of parts” through app and update that specific row - maybe with another defective column(so every update doesn’t trigger a new write).
- Get that table record that has been updated.
- Have a decision block that looks for that defective column == True. Otherwise, do nothing.
- Have 2 table create/update blocks - one to add a new record to your defects table and one that updates your original table.