Is There a Better Way to Reference Related Items from Results of Get Items from a Podio View?
I'm looking for ideas on how to better design a workflow...
In this example I have 3 apps:
- Accounts (these are businesses that are clients or prospects). Accounts has a relationship field to the Contacts app.
- Contacts (holds info such as email, phone, first name, last name) *note that this is my own app and not the Contacts built into Podio.
- Email Lists (used to create customized/filtered lists of contact emails)
The Email Lists app has fields used to describe the accounts to be included in an email list. For example, a field called Account Type which could be either All, Clients, or Prospects. If I need to create an email list of current Clients, I'll fill out a form which triggers a webhook event to create an Email List item and populate the fields (e.g. Account Type=Client) with the info submitted in the form. The Email List app also has a blank multiline text field that the next triggered flow will populate with the final email list (that I will then copy/paste into a MailChimp import - as I learn more I'd love to make this part automated but I'm not there yet).
I then have a flow that is triggered when the Email List item is created. It will Get Items from Podio View on a view corresponding to the data in the fields of the Email List (e.g. it will get items from the Podio view "Clients" in the Accounts app).
What I would like to do next is get the Contacts that are referenced from each account and add their email address, first name, and last name to a string variable (that is building into a list of emails and names that I will later write to a text box in the Email List item). However, I am unable to follow references from the Accounts I collected when doing Get Items from a Podio View.
So, instead, I have created a relationship field in the Email List app called Accounts and added each account (from the Get Items from a Podio View results) to that field. Then I Get Referenced Items on that relationship field and then follow the reference to each Account and continue to the Contacts. I then add the contact info to my string variable.
While this works, it seems to be expensive and it is very slow (e.g. took an hour) when I have lots of Accounts (I also have to work around the limit of 250 items per relationship field). The root of the problem seems to be that I can't continue a reference forward when doing a Get Items from a Podio View. I have the same problem when Searching for items as well.
Does anyone know of a better, faster way to approach this?
Thank you in advance for your ideas.
-
Hi Chris - regarding your statement "The root of the problem seems to be that I can't continue a reference forward when doing a Get Items from a Podio View"
The workaround for this is to use "run flow on collected" within a loop that processes the items you get from your view. That way the forwarded related apps/items from each collected item can be referenced using "Get Referenced" directly, because the flow is now running in the context of the collected item's app.
Let me know if that helps, or if I can offer further clarification.
-
Hi Bill,
Thanks for the help. I'm not sure how I can update the original item once I'm in the flow I triggered on the referenced item.
For example, lets say I start in the Email Lists app/item and my end goal is to populate a text box in the Email List item. I get a list of Accounts by doing Get Items from a Podio View. I then loop through each Account that is returned and trigger a flow on the Account. The flow that is triggered in the Accounts app can reference the related Contacts app from Accounts and get the necessary info (email, first name, last name) from each Contact related to that Account. But then how to I get that contact information back to the original Email Lists item?
Thanks!
-
I am thinking you'd adjust your data model slightly, whereby your Accounts app has a relationship field pointing to the Email Lists app. (this works around the 250 related items issue you mentioned, which is a "forward" relationship limit, not a "reverse" relationship limit). And then your flow on the Accounts app could do a forward Get Referenced to update any related Email List items for the Account
Please sign in to leave a comment.
Comments
4 comments