SendGrid Custom Field Error

I’m trying to assign custom fields to a contact being added to SendGrid API. There’s are field in the Pipedream configure to do it, but I’m getting the error below.

Am I formatting it wrong or something? I have in: Center:{{steps.trigger.event.newRow[8]}}

Error

Unexpected error (status code: 400): { “headers”: { “server”: “nginx”, “date”: “Sat, 12 Nov 2022 20:42:30 GMT”, “content-type”: “application/json”, “content-length”: “105”, “connection”: “close”, “x-amzn-requestid”: “28da7922-045a-40e7-871c-dff1ccaac4fe”, “access-control-allow-origin”: “*”, “access-control-allow-headers”: “AUTHORIZATION, Content-Type, On-behalf-of, x-sg-elas-acl, X-Recaptcha, X-Request-Source”, “x-amz-apigw-id”: “bgXAjGmlPHcF5tA=”, “access-control-allow-methods”: “PUT,OPTIONS,DELETE,OPTIONS”, “access-control-expose-headers”: “Link, Location”, “x-amzn-trace-id”: “Root=1-63700536-04a200fe540ff8a401b0a76f;Sampled=0”, “x-envoy-upstream-service-time”: “116”, “referrer-policy”: “strict-origin-when-cross-origin”, “x-content-type-options”: “nosniff”, “x-ratelimit-limit”: “200”, “x-ratelimit-remaining”: “199”, “x-ratelimit-reset”: “30” }, “body”: { “errors”: [ { “field”: “contacts[0].custom_fields”, “message”: “invalid custom field ids supplied - Center” } ] } }

DETAILS

    at global.handleError (/var/task/common.js:39:40)

ExportsInputsLogsDetails

Detailed/code mode

Twilio SendGrid Account

SendGrid

Email

xxx@aol.com

First Name

Nicole

Last Name

Bennett

Custom Fields

{ “Center”: “Valrico” }

Test

Test to deploy

Hi @GPL-Andrew

A 400 error means that the data you’re sending to an external API doesn’t match what that API is expecting.

Please refer to the API’s documentation and the error message in the response from the API for more details to narrow down which part of the payload is missing or is malformed.

But in that error message you shared, I can see a specific error that should help diagnose the issue:

“body”: { “errors”: [ { “field”: “contacts[0].custom_fields”, “message”: “invalid custom field ids supplied - Center” } ] } }

It looks like SendGrid is expecting a field ID, but instead was given the text "Center".

Hope this helps!