APIs & Integrations

IDev2
Member | Gold Partner
Member | Gold Partner

Cannot get value from "Select input"

SOLVE

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
1 Accepted solution
SBista
Solution
Member

Cannot get value from "Select input"

SOLVE

Change 

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

to:

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

View solution in original post

0 Upvotes
2 Replies 2
SBista
Solution
Member

Cannot get value from "Select input"

SOLVE

Change 

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

to:

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

0 Upvotes
kvlschaefer
Community Manager
Community Manager

Cannot get value from "Select input"

SOLVE

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 Upvotes