Question

What if hook result has more attributes than polling result?


Userlevel 1

Hello,
I faced a problem during the Validate Integration step before publish hook-based triggers.

I set perform_list api as guided for a hook-based trigger to pass the Validate Integration before publishing the trigger. This perform_list api returns latest data for the trigger. 

For example, [Lead Created] trigger’s perform_list api returns latest created lead data, and lead data contains custom_fields which are consist of sigle and also multiple values as below and every users(or workspace) has different custom_fields. (users can customize custom_fields. That is, custom_fields is a set of dynamic data and the data is nullable)

{ … ,
  "custom_fields": {
             "supporters": ["Emily","Susie"],
              "investor":["XXX"],
              "value": 15000000,
              "currency":"USD",
              "workspace":"workspace1"
   }
}

The problem is,
If the perform_list api returns latest lead data which has empty custom_fields like {... “custom_fields” : {} } during the composing zap by users, then users cannot use any custom_field data for the trigger zap because custom fields’ attributes would not be showing up on the zap setting page.

The topic D006 - REST Hook Trigger Needs a Polling URL from this integration checks reference(https://platform.zapier.com/docs/integration-checks-reference) says
“… If a poll has fields that a hook doesn’t, the user may map them to a later step”.

What if HOOK has fields that POLL doesn’t?
I considered includes all the custom_fields attributes(keys) by default with null values in the response of perform_list api by querying custom_field table. However, then how can I handle the custom_fields’ attributes holding multiple values like “supporters”: [“Emily”, “Susie”] as above?

What if I includes only 2 values(nulls) on supporters attribute like “supporters”: [null, null] in response of perform_list api, but the supporters attribute have always contains 5 values by their own business logic? 
Can users set 5 different values when they compose zap or on their later step of composing zap? Please let me know if it is possible.

I think there would be better ways to solve this problem. 

Any idea?

Thank you!


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