> For the complete documentation index, see [llms.txt](https://docs.syncmate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.syncmate.com/getting-started/actions/expression.md).

# Expression

Expression action is a way to freely write any JavaScript logic that you need for transforming data, you can also write use Web [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) to fetch or send any data.\
\
Important concept in Syncmate is **ctx** object that is passed from action to its children and next action. If you want to pass the data to the next actions assign your data to the **ctx** object, for example:

```javascript
ctx.computedUrl = `https://${cxx.dataFromPreviousAction}/rest/of/url`
if (Array.isArray(ctx.res.data)) {
    const lastElementIdx = ctx.res.data.length - 1
    ctx.lastElement = ctx.res.data[lastElementIdx]
}
// Only values stored in ctx object are passed to next actions.
```

<figure><img src="/files/udcmOXJ1O2Y2NCkiVV2P" alt=""><figcaption></figcaption></figure>
