How to get back metadata from an API Query that runs by JS Query

Hi,

  1. My goal: to get the headers back from the API call
  2. Issue: cannot get the metadata
  3. Steps I've taken to troubleshoot: made the same api call inside Postman
  4. Additional info: Cloud

Hello @yalondpsi !

Does your API query have a metadata property which you can access in place of the normal data property?

For example, the Retool API query below has metadata referenced via retoolAPITesting.metadata

Yes, I was able to see the metadata when I created a transformer . I need to access metadata with Javascript query. How I do it please ?

After the query has run, trigger the new JS Query and use return yourQueryName.metadata

At any time after the query has run, you should be able to use {{ yourQueryName.metadata }} in your components/events

Thank you for the help! I will try and let you know

Hi @pyrrho
It's not working. Here is my code:

const res = await setEmailSession.trigger({onSuccess:()=>{
    console.log('metadata:',setEmailSession.metadata);
  }})
  console.log('res:', res);