Pre-process a text field before the API delivers it

Hi, is there a way to pre-process a data field before the API delivers it?

I would like to replace and insert some HTML code in a text field that was edited with markdown.


You can try scripting:

Thanks Sebastian. So I can use the “query” event, great!

Is it javascript?
How do I know which commands are available and how they work? like replace, disallow and reject.

Its javascript, yes. Only the 3 commands from the docs are relevant and supported.

I’m testing the replace funtion but it seems I don’t understand its use.

Is this right for replacing all newlines with a BR?

if (ctx.isClient) { =\n/gm,"</br>");

Yes, it should work, but you do not need the “isClient”. I can prepare a sample later. Which script do you edit?

I tried something simpler, just replace all “a” for “A”, but it’s not working. I’m using the “Query” event.


Is your field localizable?

I tried a schema with a string and a number field and this works for me: = + 5; =, "A");