Search by several parameters


I am trying to create an API request, with a search action meant to search for a contact. I want to be able to run the seach with multiple search terms in different fields, and if one of them matches the query returns that contact. For example searching by:

E-mail address
Business registration number

The way I have set it up now, it seems like all fields entered are required to match in order to return a result. So for example if it searches for the correct business reg. no., but the seach also includes an outdated e-mail address - the search fails. 

Is there a way to fix this through the API request? Or must the user set up path rules in the zap in order to achieve this? 

This is the API request as of now:

 params: {
'organizationNumber': bundle.inputData.organizationNumber,
'supplierNumber': bundle.inputData.supplierNumber,
'customerNumber': bundle.inputData.customerNumber,
'memberNumber': bundle.inputData.memberNumber,
'customer': bundle.inputData.customer,
'supplier': bundle.inputData.supplier,
'inactive': bundle.inputData.inactive,

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

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

return results;

Many thanks!

0 replies

Be the first to reply!