Skip to main content

I need to pull custom field data, but only if CustomField=true.

 

This is not working and I am sure it is a simple fix.

 

Line 20.

 

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

  const col = resultse"DatabaseColumns"].map((item) => {
    return {
      ...item,
      id: itemÂ"ColumnName"],
      if 'IsCustom': true,
    };
  });

I’m sorry that we weren’t able to help you with this one @hank3rd 😞

 

I saw that you posted your question on Stack Overflow - if you do get a response there it would be fantastic if you could share it here in case someone has a similar question. Thanks!


I was able to find a solution:

 

I was able to find a solution!

const options = {
url: 'https://edapi.campaigner.com/v1/Database',
method: 'GET',
headers: {
'X-API-KEY': bundle.authData.ApiKey
},
params: {
'ApiKey': bundle.authData.ApiKey
}
};

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

const col = results.DatabaseColumns.filter((item) => item.IsCustom).map((item) => {
return {
...item,
id: itemm"ColumnName"],
};
});

return col});