Forum Discussion
Hi Mark,
Thanks for your reply. I've been trying to implement what you mentioned. I could probably get away with option 1 as the vast majority of the time it will be only adding 1-20 records at a time. It's only a rare occasion it will need to be able to handle in the hundreds. I tried the copy records too which seems to copy but having issues with the for loop condition. When doing other coding and For loops, there is normally a variable with the count iteration for the loop - doesn't something similar exist with pipelines so you could do a For loop iteration number <= quantity DO copy record"?
I set up a helper table as suggested but having troubles working out the syntax to use it.
The current steps I have been testing are (which adds 1 record):
A - Record Created (Triggers on the source table action)
B - Prepare Bulk Record Upsert
C - Search Records (Searches on source table to capture data). Query of Record ID = {{a.id}}
For Each loop contains
D - Add Bulk Upsert Row
End of For Loop
E - Commit upsert
I wasn't sure about implementing the helper table (or iteration count if possible). With a helper table my thinking is I need to insert an extra Search Record step between Steps B and C with an advanced query? How would I read the counter value to compare in the advanced query? {{b.Counter}}LTE{{a.Qty}}?
I did also try to create the second temp table with one record which is fine. The copy record function seems to be able to copy this record to the final destination table but again stuck on the loop query syntax to replicate x times.
Thanks.
------------------------------
Grant K
------------------------------
I think these would be the steps
I think your search step is on the wrong table.
A - Record Created (Triggers on the source table action) Correct
B - Prepare Bulk Record Upsert Correct
C - Search Records (Searches on source table to capture data). Query of Record ID = {{a.id}} Incorrect - you want to search the helper table with a filter that the helper record counter number is less than or equal to the # of records required from step A.
For Each loop contains
D - Add Bulk Upsert Row correct
End of For Loop
E - Commit upsert correct
------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------
- GrantK2 years agoQrew Trainee
Thanks for your assistance. Finally got it working. There is a noticeable delay when adding hundreds of records but since that is a rare situation it should be acceptable.
The advance query ended up being a simple:
{6.LTE.{{a.job_qty}}}
------------------------------
Grant K
------------------------------