I’m using the Webflow Form Submission trigger which sends all fields as a flat object, meaning if I want to use it in the Code action, I have to map each field to a variable in the GUI.
The problem is that if I ever add/remove fields in my form, I have to change the zap as well.
Ideally, Webflow would send all of the form data nested under a single variable, but since that’s unlikely to happen, I’m reaching out to the community.
Is there a way I can get all of the fields from an action nested under single variable?
To illustrate, here’s the data I get from Webflow:
{
"siteName": "Example Site",
"submittedAt": "2020-05-16T15:56:29.795Z",
"name": "Example form",
"data__Full Name": "Person A",
"data__Email": "person@example.com",
"data__Favorite Color": "Green"
}
What I’d like it to look like:
{
"siteName": "Example Site",
"submittedAt": "2020-05-16T15:56:29.795Z",
"name": "Example form",
"fields": {
"data__Full Name": "Person A",
"data__Email": "person@example.com",
"data__Favorite Color": "Green"
}
}
In the second case, I could then map “fields” as input data in the Code action.