I am trying to achieve a list of all parts required to install something selected by a user.
I want the list emailed to a user and ideally shown on a screen.
I’ll explain my current setup for your reference:
Scenario
User is adding Large Star Fairy Lights & a Balloon backboard to a list.
Action
1.
User selects the option within a form screen:
‘Fairy Lights’ type ‘Stars - Large’ and QTY ‘2’
‘Balloon Board’ type ‘Purple Board A’ and QTY ‘1’
The list of selected items goes into a table called Party Order like so:
The last column called parts needed, is a relation which refers to all the parts required to install that item from a seperate table (Party Parts Needed). That Party Parts Needed Table shows the QTY for each Part Required to Install the chosen Item and its setup like this:
Where Im stuck
I’m thinking the best way to achieve what I want would be a table where each part goes onto its own row like so like this table I have manually mocked up called Part Order Parts:
If I understand correctly you essentially want the “Parts Needed” relation to display in a table to email the user like you have shown in the “Part Order Parts” mockup?
i’m not sure how you are emailing this to the user but I would play around with creating an HTML table with the elements
e.g. in the Parts Needed Table I would create a template column of each row as an HTML row for a table, replacing each variable dynamically
but that should then give you an entire table that you can put in an email
it’s not perfect cause the items for Fairy Lights and Balloon Board are on seperate rows so you’d have to do something for that but it’s a start… maybe you need another table with all those product items which then brings in the parts needed etc…
but let me know if this is helpful and I can help further
I recommend using a webhook workflow for this process.
When a Party Order is submitted (step 1), trigger a webhook workflow and send the rowID of the new order.
In your workflow, use the Query JSON tool to extract the rowID from the webhook’s JSON body.
Next, loop through the Party Order table to find the row that matches the queried rowID. Inside that loop, add another loop to go through each item in the Parts Needed relation.
For every item in the Parts Needed relation, create a new row in the Part Order Parts table. Make sure each new row includes a reference to the Party Order ID.
Also, it’s best to use rowIDs for relations between tables instead of names, since names can change and rowIDs are more reliable.
Then, for showing it in the app, straightforward with a collection.
For an email, you can construct a HTML table through relations like Eitan suggested above.