how to get value of a variable from sc task in a client script

Yash38
Kilo Guru

how to get value of a variable from sc task in a client script if that variable is not being displayed on the task form but present in sc_task table.

 

i tried g_form.get value() but it's not working may be because it is not being displayed on the task form.

 

The variable i want to get value in client script in "Order" which show the task order in sc_task table.

 

Thanks in advance

3 REPLIES 3

BharathChintala
Mega Sage

@Yash38 

use g_form.getValue('variables.variablename);

 

Thanks,

Bharath

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala

Hi @BharathChintala 

g_form.getValue('variables.order') == '3'

 

not working.

This varibale is not present on the form but present in the table.

@Yash38 

Then best option is display business rule or GlideAjax

 

Display BR configure as below

BharathChintala_0-1673965744197.pngBharathChintala_1-1673965762016.png

Client script

BharathChintala_2-1673965775149.png

Out put

BharathChintala_3-1673965812234.png

 

RITM values

BharathChintala_4-1673965838777.png

You can get details from task also and you can run BR and Client script only for a particular items if you want.

 

Thanks

Bharath

 

Mark correct if it helped.

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala