I would like to know where the js functions present in expression editor in workflows are defined. Need to look into some OOTB functions.
I could find some sql functions in Admin->Config->SQL that corresponds to the js functions, but couldn't locate the js function definition.
Any help/hint is appreciated.
Solved! Go to Solution.
which OOB function you are looking for ? Functions definitions are present in database specific files .
For example all postgres related functions are defined inside xtk:postgresql-functions.sql
I am looking for definition of WeekDay() function.
I couldn't locate that in xtk:postgresql-functions.sql.
Let me check on this function definition code .
Please find below how weekday works:
Returns the number of day in the week following the rule: 0=Monday ...
In case argument is of type datetime - day of the week is calculated from time in client's timezone (timezone is passed to server in query). Otherwise, if argument is of type date, day of the week is calculated in timezone agnostic manner.
Hi @Deb_Tripathy ,
The fucntion defination in the back end file. It wont be available in the Client console.
mod(cast(Extract(dow FROM $tz1) as integer)+6, 7) // $tz1 -> Data with timestamp
- Malarrajan Sundarraj
It's impossible: expressions from workflows (and that appears in the nlClient UI) are only pure SQL translation expressions... You will never find any JS dedicated expression in it:
low level expression are ran directly on the DB layer. higher level expression (from JSAPI) are ran on the JS engine layer (on top of the DB layer)
If you need to add new SQL expression, you can use this documentation:
Ajout d'autres fonctions SQL | Adobe Campaign