Hello. I’m using this documentation to get value from Select Input: Accounts Dashboard | HubSpot
But the result unsuccessful. Probably you can help me.
The source code:
exports.main = async (context, sendResponse) => {
const { event } = context;
if (event && event.type === ‘SUBMIT’) {
const { example_input } = event.payload.formState.select_input;
sendResponse({
message: {
type: ‘SUCCESS’,
body: `Form submit was successful. Input’s value: ${example_input}`,
},
});
}
sendResponse({
sections: [
{
“type”: “form”,
“content”: [
{
“type”: “select”,
“name”: “select_input”,
“label”: “Single select list”,
“placeholder”: “Select a value”,
“options”: [
{
“value”: 42,
“label”: “Option 1”
},
{
“value”: true,
“label”: “Option 2”
},
{
“value”: “a string”,
“label”: “Option 3”
}
]
},
{
“type”: “button”,
“text”: “Submit form”,
“onClick”: {
“type”: “SUBMIT”,
“serverlessFunction”: “crm-card”
}
}
]
}
]
});
};