Question

Limit/Filter return results

  • 24 June 2020
  • 2 replies
  • 491 views

Hi there, 

I have a Find Action in one of my Zaps, but I want to limit the output to just one entry in the returned array. 

Basically, the Find Action looks up a record based on a user inputted ID, and then returns all of the fields for that record (lets say; name, address, age). But, I only want to make one of these fields (‘name’) available to users for the next step of their workflow. 

I’m using the default return response at the moment, but I’m not sure how to amend this to just return one object from the array rather than all of them: 
 

return z.request(options)
  .then((response) => {
    response.throwForStatus();
    const results = response.json;

    // You can do any parsing you need for results here before returning them

    return results.value;

 

Any help would be appreciated!


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

2 replies

Userlevel 7
Badge +12

@gesmuk - If you don’t mind, could you post the API response so we can see what the records look like? Thanks.

Userlevel 7
Badge +8

Hi @gesmuk - Thank you for your question! So that we can get you the right type of support, we kindly ask that you direct all developer support questions to our Support team directly: http://zpr.io/t4NNK - This helps us get an accurate capture of your account details so that we may assist you quickly. Thank you for understanding!