SiniWickramasin
7 years agoQrew Cadet
Webhook to fire for all records in table when a new record is added
I have two tables "Claims" and "Damage items". One Claim can have many Damage items so the latter is the child table. Damage items are represented using a Damage code and these codes are imported to Quickbase from an external app. When a claim is added to Claims table, there is a field that has a concatenated string of multiple damage codes. Example A1151, (Just a quick explanation of how the codes work - A1 is Front Bumper guard, 15 is Scratch and 2 is less than 2cm). This string could have upto 12 damage codes concatenated with the character "-" (eg: A1151-P4052-S3115-and so on). Using the Part function, I've created 12 separate fields (columns) in the Claims table to decode each damage code. Then I've set up a webhook to automatically create a separate child record under Damage items table for every claim that is created using a field called Damage Code.
One of the requirements is for the user to be able to modify the Damage codes in Damage Items records individually where necessary. Since these damage codes are just characters, I've also created a separate lookup table "Damage Codes" and created a relationship with the Damage Items table so the user can easily identify the damage code by a suffix with the actual text-description from a drop down menu. Eg rather than just selecting A1, the list shows as "A1 - Front Bumper guard". This lookup field (lets call it User Input field) also resides within the Damage Items table but is separate to the first Damage code field that is populated by the Webhook which is also in the Damage Items table.
In the Damage Items table, I have created another field (Damage Code Description) to decode the Code to show it as "A1 - Front Bumper guard" like format. Then I've created another Webhook to copy the value of the Damage Code Description and pass it into User Input field with the condition when a new record is added or modified and if the Damage Code is null.
This approach works well when there is only one damage code in the claim. When there are more than one Damage code, the first webhook successfully creates a child record for each damage code in the Damage Items table. But the second webhook only perform the passing of the value in one record. This is most likely due to the webhook is only able to perform an action on one record at a time and not for the other records that have been added at the same time?
Really sorry about the lengthy text, but I'm new to QB and not sure what else to do to fix this issue. Any help would be greatly appreciated!!
One of the requirements is for the user to be able to modify the Damage codes in Damage Items records individually where necessary. Since these damage codes are just characters, I've also created a separate lookup table "Damage Codes" and created a relationship with the Damage Items table so the user can easily identify the damage code by a suffix with the actual text-description from a drop down menu. Eg rather than just selecting A1, the list shows as "A1 - Front Bumper guard". This lookup field (lets call it User Input field) also resides within the Damage Items table but is separate to the first Damage code field that is populated by the Webhook which is also in the Damage Items table.
In the Damage Items table, I have created another field (Damage Code Description) to decode the Code to show it as "A1 - Front Bumper guard" like format. Then I've created another Webhook to copy the value of the Damage Code Description and pass it into User Input field with the condition when a new record is added or modified and if the Damage Code is null.
This approach works well when there is only one damage code in the claim. When there are more than one Damage code, the first webhook successfully creates a child record for each damage code in the Damage Items table. But the second webhook only perform the passing of the value in one record. This is most likely due to the webhook is only able to perform an action on one record at a time and not for the other records that have been added at the same time?
Really sorry about the lengthy text, but I'm new to QB and not sure what else to do to fix this issue. Any help would be greatly appreciated!!