how to display something that comes from a variabl...
# 🤝help
Hey, how can I display something that I have in the code to the user? I tried creating a workflow variable named "result" and then in the code I'd do workflow.result = "something" when I console.log(workflow.result) I get "something", but when I try to display it through a card, I get nothing
Hey @important-dawn-82568, encapsulate the var name in {{ double curly brackets }} and it should work 😃
do you mean like this?
this is what I get
hi @important-dawn-82568 can you try one or the other? for example, either @resultat or {{workflow.resultat}}
In my case i am not capturing the value from the user, I am filling it in the code through the "execute" action
After an API call, i fill the result variable with the result of the API call
ekip just to rule out simple fixes did you try to remove the @ in {{@resultat}} and replacing it with {{workflow.resultat}}. If you're able to, can you share a screenshot of what your variables look like?
at the same time, I am doing a console.log(workflow.resultat) in the execute code, and it gives this :
The double curly brackets or @ notation only work when the var is a string. If
is an object, try
I defined it as a string tho
here is the whole code of how I am setting this variable :
Copy code
  .then((response) => {
    if (response.ok) {
      return response.json()
    } else {
      throw new Error('API request failed when querying persons')
  .then((data) => {
    // Handle the API response data
    const matchingPersons = data.matchingPersons
    // Do something with the matchingPersons data
    const count = matchingPersons.length
    workflow.resultat = `Nous avons trouvé ${count} résultats`

    if (count > 0) {
      const firstThreePersons = matchingPersons.slice(0, 3)
      workflow.resultat += ' Les premiers résultats sont :'

      firstThreePersons.forEach((person, index) => {
        workflow.resultat += `\n${index + 1}. Nom : ${person.nom}, Téléphone : ${}`

    console.log(workflow.resultat) // this logs the right expected result
    // Continue with further logic or actions based on the response
  .catch((error) => {
    console.error('Error calling API:', error)
    // Handle the error
This setup worked well on my end. Are you calling the variable in the same way?
Yes ! exactly the same way
is it because of the fact that I fill it inside the api call
it might be a race condition, where the flow is moving on before the API call finishes
I'm not too familiar with JS, but you could maybe put an
before the fetch? Or somewhere else in the code 😅