Skip to main content
Solved

Pipeline to add Parent record from child import


Forum|alt.badge.img+8

I have two tables -- Parent Table A and Child Table B.

When importing records into Child Table B --- if there is not a Parent Table A "related record" -- I would like to create a new "Related Record" for Parent Table A --- Note: there may be multiple child records that have the same ParentID that need a "new" related parent record --- I'm not sure I would go about creating a Unique List of Parent records that need to be created. - appreciate any help.

Best answer by MarkShnierYou

OK great.

Trigger: When Record Added on Child Table

Step: Create a Bulk Upsert (for Parent table)

Step:  Add Row

Step: Commit Upsert.

It would be nice if they gave us a new Quickbase Pipeline step which would automatically merge in a single record into a  table where the key field may already exist but they don't so we have to go through the hoops of creating a Bulk Upsert with just one row in it and Committing it one row at a time. 

View original
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24

I can think of a way to do this but it requires having a custom key field on the parent table. ...   i.e. a field other than the Record ID which can be the key field.

Do you have any way to contrive a standardized format for the Custom Key field? Obviously it would have to be based on fields in the imported child records which could be combined to make a custom key field to uniquely identify the parent. 

Assuming that you can come up with a custom Key field, then what the process will be is that when each individual child record is  imported it will trigger a pipeline which will create a Bulk Upsert, add just  that 1 row, and then Commit the Upsert.

That way when two children essentially trigger at the same time both seeking to create the same parent record, the one that wins the race (Noah Lyles @ 9.784 seconds) will do the create and the one that comes in second (Kishane Thompson @ 9.789 seconds) in that race will end up doing an upsert merge.

 


MarkShnierYou
Forum|alt.badge.img+24

OK great.

Trigger: When Record Added on Child Table

Step: Create a Bulk Upsert (for Parent table)

Step:  Add Row

Step: Commit Upsert.

It would be nice if they gave us a new Quickbase Pipeline step which would automatically merge in a single record into a  table where the key field may already exist but they don't so we have to go through the hoops of creating a Bulk Upsert with just one row in it and Committing it one row at a time.