• Prêt à créer votre communauté HubSpot locale ?

    Les responsables HUG organisent des événements, favorisent les rencontres et créent des espaces où les gens peuvent apprendre et évoluer ensemble.

    Devenez un leader HUG

Cannot get value from "Select input"

IDev2
Membre | Partenaire solutions Gold
Membre | Partenaire solutions Gold

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 Votes
1 Solution acceptée
SBista
Solution
Membre

Change 

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

to:

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

Voir la solution dans l'envoi d'origine

0 Votes
2 Réponses 2
SBista
Solution
Membre

Change 

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

to:

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

0 Votes
kvlschaefer
Gestionnaire de communauté
Gestionnaire de communauté

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


loop Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.
Learn More

0 Votes