Issue with Data Transformation Not Reflecting on Run in Retool

I'm experiencing an issue with a transformer within a query in Retool. When I click "Preview" on the transformer, I can see the expected data with dates correctly formatted. However, when I click "Run", no data is returned in the application, despite the preview showing results.

Here are the details:

  • Transformer Purpose: Format date fields and replace nulls with a dash ('-').
  • Behavior Observed: "Preview" shows data, "Run" returns no results.
  • Expected Behavior: "Run" should reflect the same data as seen in "Preview".

Transformer Code Used:

return data.map(row => ({
  ...row,
  next_pre_survey_date: row.next_pre_survey_date ? moment(row.next_pre_survey_date).format('MMM D, YYYY') : '-',
  // Additional fields follow the same pattern...
}));

![4E16E1D0-1637-4794-8ED1-A2C9D24BA43D|325x500](upload://xtSKDoOnl5E26LIDRoblIVRzEFC.png)
![E7243EAE-21C5-440A-90A8-3164DA02CEB0|351x500](upload://1GAhDJPvaHwSzAbTBdfmVhjVa3v.png)

Transformer should always be running. Just reference it wherever you need.

I have the transformer directly on the query on the 'Transform results' field under the query. The issue is when pressing 'run' rather than 'preview' that there's no result.


You need to reference the query to get the result. Wherever you want to use that data you reference query1.data or query1.value I forget which is the transformed value.