Role based visibility restriction of submitted variables from the portal, forms and variable editor (Server side)Issue <span id="__caret">_</span><span id="__caret">_</span><span id="__caret">_</span>�<span id="__caret">_</span><span id="__caret">_</span>�<span id="__caret">_</span>�<span id="__caret">_</span>�<span id="__caret">_</span>�<span id="__caret">_</span>�<span id="__caret">_</span>�<span id="__caret">_</span>�<span id="__caret">_</span><!-- div.margin { padding: 10px 40px 40px 30px; } table.tocTable { border: 1px solid; border-color: #e0e0e0; background-color: #fff; } .title { color: #d1232b; font-weight: normal; font-size: 28px; } h1 { color: #d1232b; font-weight: normal; font-size: 21px; margin-bottom: 5px; border-bottom-width: 2px; border-bottom-style: solid; border-bottom-color: #cccccc; } h2 { color: #646464; font-weight: bold; font-size: 18px; } h3 { color: #000000; font-weight: bold; font-size: 16px; } h4 { color: #666666; font-weight: bold; font-size: 15px; } h5 { color: #000000; font-weight: bold; font-size: 13px; } h6 { color: #000000; font-weight: bold; font-size:14px; } ul, ol { margin-left: 0; list-style-position: outside; } --> Description Sometimes it's necessary to restrict the visibility of variables after a cat item has been submitted. For instance, variables containing certain personal data should only be visible to certain groups, such as HR. We can use client scripts and UI policies to affect this behavior on the client side, but the variables are still exposed briefly after the form loads and before the client logic executes. A better solution may be to filter these variables on the server side before the page is sent to the client. This can be accomplished with a before query business rule on table [sc_item_option_mtom]. The script would first check for the authorized role and then, if the user doesn't have the role, modify the query to exclude the restricted variables. Procedure 1. Create a new before query business rule on [sc_item_option_mtom] 2. Paste in the sample script shown below 3. Adjust the role and variable sys_id(s). A variable sys_id is the sys_id of the variable's definition record on table [item_option_new]. Sample Script: (function executeRule(current, previous /*null when async*/) { var parms = { // Restricted variables restrVars: [ '0aa6e99edb8a53006f1fd49fdf9619eb', //variable1 '69a136b7dbbc830038cf546fdf961936' //variable2 ], // Role required to see the variable values requiredRole: 'fin_data_user' }; // Build the query fragment for the restricted variables var exclusions = 'sc_item_option.item_option_new!=' + parms.restrVars.join( '^sc_item_option.item_option_new!=' ); // If the user doesn't have the necessary role !gs.hasRole( parms.requiredRole ) && /* Omit sc_item_option records associated with the restricted variable(s) */ current.addEncodedQuery( exclusions ); })(current, previous); Result: Applicable Versions London, Madrid Additional Information n/a