Cannot use a custom function in Query JSON with SQL

Hi there,

In my workflow I developed a small function called "get_domain".
I used it in a Retool database query without a problem.
Now I want to use that function in a "Query JSON with SQL".
However I get this error: "alasql.fn.get_domain is not a function".
Can anybody help me here?
Does alaSQL support custom functions?

kind regards
Reyer

alaSQL does have some limitations AFAIK but check this out

Does anyone have experience with such a function and its syntax?

I am sure that if you share your query someone here can assist but more information is needed.

This is the query (Query JSON with SQL) I'm talking about.
It's a query in my workflow.

SELECT
ID,
get_domain(Referrer) as domain,
TranslationID
from {{scanDD.data.Items }};

ScanDD is a scan on a DynamoDB database.
get_domain is a function I defined in the workflow:
wf1

When I run the query I get this error: "alasql.fn.get_domain is not a function".
I used the same function in a different query on a Postgres database without a problem.

Any idea how to solve this?

Reyer

Hello! It sounds like you're maybe trying to call a function (https://docs.retool.com/workflows/guides/functions) in your Query JSON with SQL block, is that correct? If so, this actually isn't supported—functions can only be called with JS blocks.

Correct Victoria.
It's clear.
Thank you.

Wonderful, happy to hear that! Let us know if we can help with anything else going forward.