How to Insert Variables Inside `Embeds` for Discord?

This topic was automatically generated from Slack. You can find the original thread here.

Hi, need some assistance. I can not insert variables inside embeds for discord, everything works with static text, but no luck to add a variable inside. Please help how to add variable?

Overall looks correct, what is the error you’re getting?

If you remove the double quotes around {{steps.trigger.event.snippet.title}}, does it work?

Another suggestion is to return that array of object from a node.js step, and then reference it in the Discord step

i tried everything u listed does not work.

The error is push is not a function

the issue is that all the list is in {{ }} and variable is using same, so using {{ }} inside {{ }} result like this {{ {{ }} }} is giving error push is not a function

Oh got it, then easiest way to fix is to create a code step

And use `` for string interpolation

can u give me an example what u mean by code step?

I mean a new step, click the plus button and select Node.js step

can you give an example of a nodejs step that uses string interpolation with the variable steps.trigger.event.snippet.title

Certainly! Here’s an example of a Node.js step in a Pipedream workflow that uses string interpolation with the variable steps.trigger.event.snippet.title: export default defineComponent({ async run({ steps, $ }) { // Access the title from the trigger event const title = steps.trigger.event.snippet.title; // Use string interpolation to create a message const message = `The title of the event is: ${title}`; // Log the message to the console console.log(message); // Return the message return message; }, }); In this example, we access the title from steps.trigger.event.snippet.title and use string interpolation to include it in a message. The message is then logged to the console and returned from the step.