[4.5] - Include variable in EVAL block

Posted by IramK on 21-Jun-2017 05:09

Hello,

Is there a way I can include a variable in an #EVAL block when using Browser-side API?

var str = "146201,146202";

  var returnVal = `#EVAL[var arr = rbv_api.selectQuery2('SELECT id, name, taskSubject, taskType#value, taskCategory#value, dueDate FROM ap_task WHERE id IN(?) ORDER BY dueDate ASC', 0, 10, '"` + str + `"');]` // doesn't work :(

Cheers.

Iram



All Replies

Posted by Shiva Duriseati on 03-Jul-2017 10:58

Hi Iram,

EVAL block is calculated on server side and replaced by result before sending HTML/JavaScript to the browser. For that reason EVAL block cannot use browser-side variables. It can, however, use any template tokens available from tokenhelpers  dropdown in the UI.

Please use Client Side select query.

Regards,

Shiva

Posted by IramK on 04-Jul-2017 08:22

Can you provide an example for that please?

Iram

This thread is closed