I have made an automation through Zapier to create some collection items through a form, however, I am facing an issue.
My Collections include multi-reference fields to other collections, and for now to get around that I have turned them into plain text fields. However, it is important for these to still be multi-reference fields so I can access the data within the nested collections.
To do this, I need to have the item ID as a field within the item so that Zapier can assign the correct nested collection items to the main collection item.
My question: Is there a way to automatically store an item’s ID as a field within the item? Even if that involves custom code?
It is possible to do it manually, but this would defeat the purpose of user forms.
Without unpacking your project in detail I can only give general guidance.
Here are a few common approaches;
Store your multi-ref lookup table at the Zapier level and do the translation there from e.g. a slug. This will require updating if the table updates.
Build a process to do the updating. If the mutli-ref source is < 100 records you can likely retrieve it in a single API call.
Another approach is to feed Zapier the data it needs from the form itself. While there isn’t a direct way to emit the ItemID into the form ( collection list, generating checkboxes or a select element, etc. ), you can do this using a custom field.
Essentially, you’d;
Create a new field on your multiref target collection, e.g. accessible-item-id
Build a separate Zap that triggers off of a new CMS item create, turns around and updates it by storing the ItemID in that custom field.
That field is now accessible in your collection lists
You can now build your form so that it contains it, and passes it to the Zap
I followed your advice and found that through a multi-step Zap, I can grab that items’ ID and append it to the Item as a custom field through an update item Zap! Just need to have the paid version of Zapier to do so.