Cannot get value from "Select input"

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”
}
}
]
}
]
});
};

Hi @IDev2,

Thanks for your question.

Can you include any additional details or screenshots? For example, are you getting a response, but not the one you expect? An error and error message? Or something else? This context helps the community to understand your issue.

Hey, @stefen @ChrisoKlepke, do you have any suggestions? Or thoughts on how they can troubleshoot their project?

Thank you!

Best,

Kristen

Change

const { example_input } = event.payload.formState.select_input;

to:

**const { example_input } =

context.

event.payload.formState.select_input;**