Data with one to many relation

:bullseye: What is your goal?

Hi,
I hope someone can help me out in structuring data, I’m getting data from HubSpot from different associted objects. The information has to be entered in a Google sheet.Getting the information from HubSpot Works, putting it in a sheet works also fine in a one-to-one relation. So:

contract → deal → contact

And this information in written in a Google Sheet, like (simplified)

Contract name | Deal name | Deal stage | Deal amount | Contact name | Contact address

However now we have the change a contract can have many deals, so

contract → deal → contact
→ deal → contact

And it should end up in a sheet like

Contract name | Deal name A | Deal stage A | Deal amount A | Contact name A | Contact address A
Contract name | Deal name B | Deal stage B | Deal amount B | Contact name B | Contact address B

And that doesn’t work with m,y workflow :wink: So I figured I first have to put all deal/contact data in an array and read the array while filling the sheet.

Is this the correct way? How do I do this?

Thank you so much.

Jeroen

:thinking: What is the problem & what have you tried?

see above

:clipboard: Error messages or input/output bundles

No error messages

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

3 Likes

Hi @Jeroen_Beelen

It’s hard to figure it out without seeing the exact data structures that result from each API call, but my guess would be that you need to add aggregators before the last “Set multiple variables” module.

On the first branch alone, you have 3 Iterators: One for each Contract, then one for each Contact of each Contract, then another for the Contact IDs of each Contact.

If you add aggregators, setting the Source module to each individual Iterator and using the resulting array of each aggregator, you’ll naturally end up with the exact data structure you want.

@damato

Hi @Jeroen_Beelen ,

Could you please share more details about the issue you’re facing?
It would be helpful if you could include screenshots of the error, the module flow, and the scenario setup.
If possible, please also share the scenario blueprint so we can troubleshoot the issue more effectively.

Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation

1 Like

Thank for your quick reply, I’ll have a look!

1 Like

Hi, thanks for the reply. It’s not an error, it’s an addition. However I made it work, arranging the steps.

1 Like

Arranging the apps made it work for me.

2 Likes