Best answer

Extra keys warning for dynamically generated data

  • 2 July 2021
  • 1 reply
  • 73 views

Hey there I keep getting the error:


Polling sample in Zap 124855126 includes fields not found in latest task history (ID: 00097173-c64e-a25a-a714-696d6b6fc2b1); extra keys: "custom_field_133867", "custom_field_133868", "custom_field_69432", "custom_field_69433", "custom_field_69435", "custom_field_69436", "custom_field_77580"

now I'm not sure why since I have a custom function that queries these labels:

const customerOutputFields = (z, bundle) => {
const response = z.request(
"https://app.zenmaid.com/api/zapier/v1/customers/custom_field_definitions"
);
// json is like [{"key":"field_1","label":"Label for Custom Field"}]
return response.then((res) => res.json);
};

Since it’s a dynamic field name I’m not really sure how to sample it properly, or even if I need to. If I don’t then I’m not sure why I’m receiving this error. If I do, then is there documentation on how to write this? I haven’t seen it in their documentation any where.

 

For some context, these are optional custom fields that they can fill in (but don’t) when making a customer. So sometimes it’ll load blank.

 

sample: {
id: 123,
first_name: "Debbie",
last_name: "Cardone",
display_name: "Mrs Debbie Cardone ()",
created_at: "2018-12-03T18:42:15-06:00",
company_name: "CReason",
title: "Mrs",
notes: "Test Notes",
balance: "0.0",
revenue: "0.0",
is_lead: true,
is_imported: false,
marketing_source: "Zapier",
is_recurring: false,
is_churned: false,
is_new: true,
preferred_payment_method: "Credit Card",
birth_date: "2018-01-01",
recurrence_frequency: "weekly",
emails: [
{
address: "email@test.com",
email_type: "Work",
is_automatable: true,
},
],
phone_numbers: [
{
display_line: "(541) 555-3003",
phone_number: "+15415553003",
phone_number_type: "Mobile",
},
],
service_addresses: [
{
line1: "123 Line 1",
line2: "Line 2",
city: "Dallas",
state: "TX",
postal_code: "123 456",
iso_country_code_2: "US",
latitude: 12.0,
longitude: 34.0,
display_line: "123 Line 1 - Line 2. 123 456 Dallas TX",
},
],
billing_addresses: [
{
line1: "456 Line 1",
line2: "Line 2",
city: "Dallas",
state: "TX",
postal_code: "789 456",
iso_country_code_2: "US",
latitude: 12.0,
longitude: 34.0,
display_line: "456 Line 1 - Line 2. 123 456 Dallas TX",
},
],
custom_fields: [
{
label: "Alarm code",
value: "1234#",
},
],
},

 

Thanks in advance, sorry if this is blatantly obvious!

icon

Best answer by Zane 12 July 2021, 20:54

View original

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

1 reply

Userlevel 7
Badge +9

Your static sample must include only fields that are statically defined. Think of it as a “least common denominator” for your data - which fields are guaranteed to be there for every user, for any successful API call. Custom fields, by definition, are not universal (otherwise you could just create them statically and save an API call).

A major use case for static sample is setting up Zap Templates. This is done without configuring auth, and without making any api calls for custom fields. This check is ensuring that Zap Templates will work in 100% of cases - i.e. any field mapped is guaranteed to be there when any Zap runs.