Webhook Displays [object Object] Instead of Custom Question #20225
Replies: 1 comment 2 replies
-
|
Hey @MashdorDev! 👋 I'm here to help you with bugs, questions, and even becoming a contributor. Let's squash those bugs together! To ensure your custom question appears as text in Discord instead of displaying as
Here's an example of how you might modify your webhook payload: // Assuming you have a custom question object
const customQuestion = { question: "Is it for Co-Op?", answer: "Yes" };
// Convert the custom question object to a string
const customQuestionString = JSON.stringify(customQuestion);
// Update your webhook payload
const webhookPayload = {
"content": "Hey <@199537112133926913> and <@1247356692136726611>, an interview has been {{triggerEvent}}!",
"embeds": [
{
"title": "Interview to Astro with {{attendees.0.name}}",
"fields": [
{
"name": "👤 Attendee Name",
"value": "{{attendees.0.name}}",
"inline": true
},
{
"name": "📧 Attendee Email",
"value": "{{attendees.0.email}}",
"inline": true
},
{
"name": "📜 Resume",
"value": "[Resume Storage](https://storage.astrogamestudios.com/index.php/f/6954)"
},
{
"name": "Is it for Co-Op | Metadata check?",
"value": customQuestionString // Use the stringified custom question here
},
{
"name": "📍 Location",
"value": "Join The Call - [Link]({{metadata.videoCallUrl}})",
"inline": false
},
{
"name": "🔗 Booking Link",
"value": "[View Booking](https://app.cal.com/booking/{{uid}})",
"inline": true
},
{
"name": "📅 Reschedule",
"value": "[Click to Reschedule the Booking](https://app.cal.com/booking/{{rescheduleUid}})",
"inline": true
}
],
"color": 3066993,
"timestamp": "{{createdAt}}"
}
]
};By stringifying the custom question, you ensure it is sent as a text string in the webhook payload, which Discord can display correctly [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I'm currently using a webhook to send interview notifications to Discord. The webhook works as expected for default questions, but when I add a custom question, it does not display correctly and instead shows
[object Object]. I tried to use the metadata but I can't really peak into it to retrieve the correct info I needWebhook Payload
Here's an example of the webhook payload I'm sending:
{ "content": "Hey <@199537112133926913> and <@1247356692136726611>, an interview has been {{triggerEvent}}!", "embeds": [ { "title": "Interview to Astro with {{attendees.0.name}}", "fields": [ { "name": "👤 Attendee Name", "value": "{{attendees.0.name}}", "inline": true }, { "name": "📧 Attendee Email", "value": "{{attendees.0.email}}", "inline": true }, { "name": "📜 Resume", "value": "[Resume Storage](https://storage.astrogamestudios.com/index.php/f/6954)" }, { "name": "Is it for Co-Op | Metadata check?", "value": "{{metadata}}" }, { "name": "📍 Location", "value": "Join The Call - [Link]({{metadata.videoCallUrl}})", "inline": false }, { "name": "🔗 Booking Link", "value": "[View Booking](https://app.cal.com/booking/{{uid}})", "inline": true }, { "name": "📅 Reschedule", "value": "[Click to Reschedule the Booking](https://app.cal.com/booking/{{rescheduleUid}})", "inline": true } ], "color": 3066993, "timestamp": "{{createdAt}}" } ] }Issue Details
[object Object].Expected Behavior
I expect the webhook to display the actual custom question's value instead of
[object Object]. But I can't peak into itQuestions
An image of how it looks on discord side

Beta Was this translation helpful? Give feedback.
All reactions