Create .csv file containing all child rows with a given parent id

I'm trying to use an automation to create a file (.csv) containing rows from a child table that match a parent id. The automation reliably triggers per the data change event I have set for the parent table--when the parent table's "Ready for Export" column changes to "Y", the automation goes to work. However, I'm having trouble figuring out how to connect the parent table's automation (which has the trigger) to the child table's automation (which has the task to create the file). I'm sure I don't understand how to use the "Call a process" step or whichever other type of step I should be using, the documentation is at least partially unclear to me, and in the forum I don't find explanations but rather mostly comments that others also find the documentation unclear in various details.

I very much appreciate any guidance anyone can provide.

Here's my "Call a process" step and the expression for the child row ID field. The expression is intended to select the child row IDs where the parent ID matches the ID of the row that triggered the automation. I see that it may not make sense to return a list for a text ID field, but I don't know what to do instead.

dbaum_1-1650523160398.png

dbaum_2-1650523410404.png

Here's the child table's process that I'm trying to call from the parent table's process.

dbaum_5-1650523585386.png

 

Here's the error I see in the Automation Monitor.

dbaum_6-1650523817195.png

 

Solved Solved
1 4 440
1 ACCEPTED SOLUTION

Hello @dbaum 

I could not find ways to pass a list of child id's for CSV export created again the child table.

However I was able to come up with a different approach you might want to try.

Instead of calling a CSV export defined on the child table, just use a CSV export created on the parent table with a template similar to below;

 

"ch_id","p_id","fld"
<<START: [Related childrens]>>
"<<[ch_id]>>","<<[p_id]>>","<<[fld]>>"
<<END>>

 

Hope this works for you.

(The fields are all defined in the child table)

View solution in original post

4 REPLIES 4

Hello @dbaum 

I could not find ways to pass a list of child id's for CSV export created again the child table.

However I was able to come up with a different approach you might want to try.

Instead of calling a CSV export defined on the child table, just use a CSV export created on the parent table with a template similar to below;

 

"ch_id","p_id","fld"
<<START: [Related childrens]>>
"<<[ch_id]>>","<<[p_id]>>","<<[fld]>>"
<<END>>

 

Hope this works for you.

(The fields are all defined in the child table)

Thanks so much!!! I really appreciate your explanation. That provides exactly what's needed. I hadn't previously encountered the Using Start expressions in templates, so that was very helpful to learn.

For others who land here, a description of @TeeSee1's template example is:

  • Create the csv header and data rows just like you want them--it's not even necessary to include the child/parent ID columns
  • Following the csv header row, insert the START expression referencing the list of key values for the desired child rows (e.g., a REF_ROWS() column from the parent table)
  • Following the csv data row, insert the END expression

Glad it works for you and thanks for your annotation!

Hi Guys

Can you please explain this example more in depth? I have the same problem regarding this question.

Top Labels in this Space