APIs & Integrations

IDev2
Mitglied | Gold Partner
Mitglied | Gold Partner

Cannot get value from "Select input"

Hello. I'm using this documentation to get value from Select Input: https://developers.hubspot.com/docs/platform/create-custom-cards-with-projects#select-input

 

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

0 Upvotes
2 Antworten
SBista
Mitglied

Cannot get value from "Select input"

Change 

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

to:

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

0 Upvotes
kvlschaefer
Community-Manager/-in
Community-Manager/-in

Cannot get value from "Select input"

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


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !
0 Upvotes