Best Practice for lookup of item IDs

Hi all,

I’ve run into a recurring challenge when working with modules like “List Tags”, “List Contacts”, etc., especially seen in integrations with email marketing tools I have been evaluating in the past (e.g. GetResponse, KlickTipp).

Let’s say I want to update a contact or assign a tag: in many cases, these modules require the ID of the tag or contact, not their name or email.
That means I first need to look up the ID using a “List xyz” module, filtering by name/email.

My approach here is to create a separate scenario to make this functionality re-usable. The scenario takes an array of email addresses, aggregates this to one bundle, then iterates through all addresses and filters out all addresses which are not contained in the input array. Then an aggregator creates the result list and the scenario output is set with a map function to only get the ids (instead of list of collections).

Other Example for getting tag IDs:

Question 1: is there a better/leaner/shorter approach?

And:

By default, these “list all xyz” modules only return a limited number of results (usually 10).
If the desired item is not among the first 10, the lookup fails — even though the item exists.

That leads me to my second question:

If my approach is correct, is it then considered best practice to always increase the “limit” (e.g. to 1000) when using List modules for ID lookups — even if I only need one match?

It feels unintuitive to manually increase the limit just to ensure a reliable match.
But without doing so, the lookup workflows will fail.

I’d love to understand the reasoning behind this design and whether I’m missing a more efficient or recommended pattern.

Thanks a lot!

Simon

It depends on how the external service exposes their API. Some only has a list endpoint, while others have a search endpoint.

The best way is to probably perform the list and aggregator within a custom app, if there is no search module/endpoint available.

Hope this helps! Let me know if there are any further questions or issues.

@samliew