Skip to main content
Best answer

How to find multiple records in a Salesforce object?

  • October 14, 2020
  • 12 replies
  • 2094 views

donovanwatts
Forum|alt.badge.img+2

Hello,

We have an object called Opportunity Team. This object can have one or more records (Team Members) in it. I can successfully find the first record using ‘Find Record in Salesforce.’ But what about the other records, if there are any? How do I find those when Zapier only returns the first one?

Best answer by christina.d

Hi all! I wanted to loop back here and update this thread with some good news!

We recently updated the Find Record(s) search on the Salesforce integration to be able to return all records found, instead of just the first record found for each search value. To setup your Zap this way, use the Salesforce integration's "Find Record(s)" search and set the "Search Results" option to "Return all matching record(s)".

One thing to note, this functionality is only available in the Salesforce integration, and not in the Salesforce (Legacy), Essentials, or Marketing Cloud integrations. If your search step hits a time out error, you may be trying to return too many records at once - try narrowing your search. 🙂

 

I hope this helps!

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

12 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • October 15, 2020

How are you searching for the Opportunity Team object? (Perhaps provide screenshots.)

The Opportunity Team record should contain an array of Team Members.


donovanwatts
Forum|alt.badge.img+2
  • Author
  • Tinkerer
  • October 15, 2020

Hi Troy, I’m passing the Opportunity Object ID via a webhook. I then lookup the Opportunity Team based on that value. I use ‘Find Record(s) in Salesforce’ which reveals the first record (Team Member) in the list. However, for my example, there are four records on the Opportunity Team. Shen I view the results, I only see the first record. Here’s a screenshot of my zap step on one side, the Opportunity Team object on the other.

 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • October 15, 2020

In the Zap you’re finding the object “Opportunity Team Member” which may be different than the object “Opportunity Team” or just “Opportunity”, hence likely why only 1 result is being returned.


donovanwatts
Forum|alt.badge.img+2
  • Author
  • Tinkerer
  • October 15, 2020

I was wondering about that. However, I don’t see an Opportunity Team object so I figured I had to work with Opportunity Team Member instead.

Originally, I tried getting this list from the Opportunity, but couldn’t find any of the team members. 


  • New
  • December 10, 2020

I’m running into the same issue as Donovan. I have two objects in Salesforce related by a lookup relationship that I need to pull into my Zap. I’m sending the parent record ID to Zapier via webhook, then using the Find step to locate child records, and I’m only seeing one record returned in the array. It’s definitely not an issue with the architecture or the objects I’m using, so wondering if anyone had any other troubleshooting thoughts, or if Donovan, you were ever able to figure out your Zap?

 

 


donovanwatts
Forum|alt.badge.img+2
  • Author
  • Tinkerer
  • December 10, 2020

I couldn’t figure out how to get all the records. only the first. so, I took that extreme measure of triggering off of any new Opportunity Team member being added to Salesforce matching a certain condition and then building up a rather complex Airtable to house that which already exists in Salesforce. way more convoluted than it needs to be but hey, when you can’t figure something out and you need a solution, I find that Airtable always comes to my rescue.

my life would be considerably easier if I could figure out how to retrieve all the members of an Opportunity Team instead of just the first one only.


  • New
  • December 15, 2020

Hi everyone,

I am stuck with a similar situation, I am querying the records using “Find Record(s) in Salesforce” option but it gives me just one record. The same query when run in Salesforce returns 2 results.


Danvers
Forum|alt.badge.img+12
  • Zapier Staff
  • December 15, 2020

Hi @UmairJ!

The Find Record(s) action will only return one result in a Zap, which is why you aren’t seeing the two that you’d otherwise find if you run the same query in Salesforce. 

Edit to update - this isn’t correct, the Find Record(s) action should return more than one record if they are found. 

It sounds like @donovanwatts found a workaround using Airtable though 🙂


donovanwatts
Forum|alt.badge.img+2
  • Author
  • Tinkerer
  • December 15, 2020

Here’s a diagram of the part of my solution whereby I trigger off of a new record in Salesforce on the Opportunity Team Member Object. Once this info is stored in Airtable, I’m able to retrieve it later to do that which I need to do.

PS - This graphic is an export from the Mac app Diagrams, which I use to create diagrams for all of my Zap workflows. It’s extremely helpful to have an accompanying diagram that I can refer to when building out, troubleshooting, or simply documenting my Zaps.

 


  • New
  • December 17, 2020

Hi @Danvers,

Thank you. I thought as it says Record(s) it will return multiple records. Unfortunately Airtables aren’t a possiblity for us.


Danvers
Forum|alt.badge.img+12
  • Zapier Staff
  • December 18, 2020

@UmairJ and @donovanwatts I got this wrong! The Find record(s) search action should find more than one record if there is one and will return the results as line items. I’m sorry - I got mixed up with a different action! 

 

You mentioned that the Zap search is only giving you one result but when you do the same query in Salesforce it gives two. Could you first double-check the queries to make sure that there isn’t a sneaky difference between what the Zap is doing and what’s happening in Salesforce? If that doesn’t shine a light on the problem, the best thing to do will be to contact the Support Team so that they can dig into this with you. The best way to do that is using the Get Help form: https://zapier.com/app/get-help 


christina.d
Forum|alt.badge.img+9
  • Zapier Staff
  • Answer
  • March 29, 2022

Hi all! I wanted to loop back here and update this thread with some good news!

We recently updated the Find Record(s) search on the Salesforce integration to be able to return all records found, instead of just the first record found for each search value. To setup your Zap this way, use the Salesforce integration's "Find Record(s)" search and set the "Search Results" option to "Return all matching record(s)".

One thing to note, this functionality is only available in the Salesforce integration, and not in the Salesforce (Legacy), Essentials, or Marketing Cloud integrations. If your search step hits a time out error, you may be trying to return too many records at once - try narrowing your search. 🙂

 

I hope this helps!