Skip to main content
Best answer

How do I use looping to retrieve client details instead of Client ID in Zapier?


Hi

 

I have a zap that populates a google doc from information retrieved from a custom crm on zapier. 

The zap easily retireves client 1’s details (full name and email address) and ive been told to use looping to retrieve subsequent client details.

Issue i have is that the looping function only retrieves a ‘client id’ instead of the details associated with the client i.d i.e name, email address etc from the CRM. 

Anyone know how i can get the client I.D to pull the client details which in turn will allow me to prepopulate the google doc please?

 

 

Best answer by SamB

amazing thank you, so i should put the  same ‘full name’ from the lopping action 7 in both client1 & client2 like in this?

You’re welcome, ​@MAIN MORT! 🤗 

Ah, yes Ken is quite right. If you map the same field to two different fields like that, the same value will be added to both of those client fields on each of the loop iterations.

Are there always going to be a maximum of two clients that you would want to add to the same client agreement? If so, I think you were along the right lines with your first approach of using Formatter actions to split the client details. But it’s a Formatter Utilities action you’d need instead of Text, and you’d want to get rid of the Looping action if you’re only wanting to generate one client agreement—sorry for not picking up on that previously! 

Assuming the client details are being output as line items by the Acre app you could use Formatter’s (Utilities > Line-item to Text) action to split the client details into two separate fields. That way you wouldn’t need the Looping action and could just map the individual fields from the Formatter actions. You can learn more about how to use that type of Formatter action here: Convert line items into text strings.

Hope that helps to clarify the approach needed. If you give it a try and run into any issues do let us know!

View original

11 replies

ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • 6423 replies
  • February 26, 2025

Hi there ​@MAIN MORT,

Welcome to the Community! 🎉

Before we dig deeper into this, would you mind sharing a detailed screenshot of how your Zap is configured? This will help me take a closer look and provide the best possible suggestion.

Please don't include personal information in the screenshot, or be sure blur out any personal information.

Thanks!


Forum|alt.badge.img+5

Use the “Search Clients” or something similar action in your custom CRM to get a list of client IDs. Check if this action returns only IDs or full client objects by testing it and then try looping. If the search only returns client IDs, add a “Get Client Details” action (or similar) inside the loop. Pass the client ID from the loop to fetch the full details, including name and email. Ensure the Google Doc action (e.g., “Append to Document”) is inside the loop, using the details from the “Get Client Details” action to add each client’s information. If you want a single doc with all clients, set it to append to the same document each time.


  • Author
  • Beginner
  • 5 replies
  • February 27, 2025
pranayshinde wrote:

Use the “Search Clients” or something similar action in your custom CRM to get a list of client IDs. Check if this action returns only IDs or full client objects by testing it and then try looping. If the search only returns client IDs, add a “Get Client Details” action (or similar) inside the loop. Pass the client ID from the loop to fetch the full details, including name and email. Ensure the Google Doc action (e.g., “Append to Document”) is inside the loop, using the details from the “Get Client Details” action to add each client’s information. If you want a single doc with all clients, set it to append to the same document each time.

thanks  

this is the ideal flow if there was only 1 client - (This works just fine)

 

The issue is that the search for clients only pulls the full objects for client 1. any subsequent clients details are not pulled using the search function. so if there are 2 clients on a case, i can get full objects for client 1 but Just the client i.ds for any subsequent clients

 

 

below is the looping segment i added for if there was 2 clients. the client objects from the document in segment 2 pull the full client details but only as 1 token i.e Email will just pull all of the emails on the case seperated by commas so i tried this method to just atleast grab the details which i could then try and filter to sperate and then append to a google doc. 

 

this worked ok after testing and  I can see both clients in the loop test.

 

the issue i now have is getting the details into google doc from the loop as it still only gives me the 1st clients details i.e full name and email address

 

so I tried to add a filter that would seperate the names from the loop which should then allow me to use the details but to no avail as the filtered results dont give me the individual details but instead both client names with the comma 🤷‍♂️

 

apologies for the post or if i have over complicated it for no reason.


  • Author
  • Beginner
  • 5 replies
  • February 27, 2025
ken.a wrote:

Hi there ​@MAIN MORT,

Welcome to the Community! 🎉

Before we dig deeper into this, would you mind sharing a detailed screenshot of how your Zap is configured? This will help me take a closer look and provide the best possible suggestion.

Please don't include personal information in the screenshot, or be sure blur out any personal information.

Thanks!

please see below post reply


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7547 replies
  • February 28, 2025

Hey there, ​@MAIN MORT 👋

Thanks for sharing those helpful screenshots. Those ClientID, Email and Full Name fields from the Looping action that only show the 1st client’s details are the ones you’d need to select in that Google Docs action.

When testing in the Zap editor it will only perform a test with the details for the first loop, but when the Zap is switched on and runs, it will create loops for each set of client details and run through them separately. With the fields mapped directly from the looping action there should be no need to use Formatter split up the values, so you can remove that Formatter action from the Zap.

Can you give that a try and let us know how you get on?


  • Author
  • Beginner
  • 5 replies
  • February 28, 2025
SamB wrote:

Hey there, ​@MAIN MORT 👋

Thanks for sharing those helpful screenshots. Those ClientID, Email and Full Name fields from the Looping action that only show the 1st client’s details are the ones you’d need to select in that Google Docs action.

When testing in the Zap editor it will only perform a test with the details for the first loop, but when the Zap is switched on and runs, it will create loops for each set of client details and run through them separately. With the fields mapped directly from the looping action there should be no need to use Formatter split up the values, so you can remove that Formatter action from the Zap.

Can you give that a try and let us know how you get on?

 

amazing thank you, so i should put the  same ‘full name’ from the lopping action 7 in both client1 & client2 like in this?

 


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • 6423 replies
  • March 3, 2025

Hi ​@MAIN MORT,

I believe once the Zap runs, it will put the same data on the “client1” and “client2” field. Have you tried doing a live test by publishing the Zap?

I'll be keeping an eye out for your response!


  • Author
  • Beginner
  • 5 replies
  • March 3, 2025

thanks ​@ken.a 

 

No I havent run the test but I need the data carried over to be different for client 1 & Client 2 hence the reason for the post really!

 


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7547 replies
  • Answer
  • March 3, 2025

amazing thank you, so i should put the  same ‘full name’ from the lopping action 7 in both client1 & client2 like in this?

You’re welcome, ​@MAIN MORT! 🤗 

Ah, yes Ken is quite right. If you map the same field to two different fields like that, the same value will be added to both of those client fields on each of the loop iterations.

Are there always going to be a maximum of two clients that you would want to add to the same client agreement? If so, I think you were along the right lines with your first approach of using Formatter actions to split the client details. But it’s a Formatter Utilities action you’d need instead of Text, and you’d want to get rid of the Looping action if you’re only wanting to generate one client agreement—sorry for not picking up on that previously! 

Assuming the client details are being output as line items by the Acre app you could use Formatter’s (Utilities > Line-item to Text) action to split the client details into two separate fields. That way you wouldn’t need the Looping action and could just map the individual fields from the Formatter actions. You can learn more about how to use that type of Formatter action here: Convert line items into text strings.

Hope that helps to clarify the approach needed. If you give it a try and run into any issues do let us know!


  • Author
  • Beginner
  • 5 replies
  • March 6, 2025

@SamB this worked perfectly thank you


ken.a
Forum|alt.badge.img+6
  • Zapier Staff
  • 6423 replies
  • March 7, 2025

That’s awesome ​@MAIN MORT! A huge thanks to SamB for pointing you in the right direction!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗