How to get catalog variables display value from business rule.

chenglo
Tera Contributor

Hi Expert, 

Can any one help me on this? I'd like to get display value of catalog variable by business rule to insert into another table while user submit a form. The form is on HR table and I need to copy a value to another table for report purpose.

thanks for your support.

Regards, 

Cheng

 

1 ACCEPTED SOLUTION

VigneshMC
Mega Sage

Try 

current.variables.<variable_name>.getDisplayValue();

Thanks

View solution in original post

4 REPLIES 4

VigneshMC
Mega Sage

Try 

current.variables.<variable_name>.getDisplayValue();

Thanks

Hi Vignesh, 

 

Thanks for your help, it's working for me.

 

Regards,

Cheng

Hi, your solution returns me a value of undefined

(function executeRule(current, previous /*null when async*/) {
    var nonAlphanumeric = "#!%&$*-+/";
    var numbers = "0123456789";
    var lowercaseLetters = "abcdefghijklmnstuvwxyz";
    var uppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var stringLength = 3;
    var randomString = "";
    var randomNum = 0;
    
    
    
    var regExp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})";

    gs.info("P: " + current.variables.user_password.getDisplayValue()); //undefined
    gs.info("FN: " + current.variables.first_name.getDisplayValue()); //undefined
    
   

Priyanka136
Mega Guru

Hi chenglo,

Refer this:-

https://community.servicenow.com/community?id=community_question&sys_id=99001fa5dbdcdbc01dcaf3231f96...

I hope this helps. Please mark correct/helpful based on impact....!!!!!

Warm Regards,

Priyanka

find_real_file.png

www.dxsherpa.com