Email section visibility in activity stream compose in UI builder

khareakshay
Tera Expert

I have a custom condition configured for the visibility of email section in activity stream compose in CSM workspace which hide or unhide the email section based on certain conditions. I want to check these condition but unable to find where this is configured. Please refer the attached image and guide where I can find the custom condition

khareakshay_1-1784874424005.png

 



 

 

2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron

@khareakshay 

this link has solution

Service Operations Workspace – How to display the “Email” section in Compose pane for some states? 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Hi @khareakshay ,
If you want to pass the value present in the form, pass the sys_id from the UI Builder Page and here in the data broker GlideRecord to that table and get the value of u_lcc_account value.
Copy paste the following in the properties field of the Data broker,

[
 {
        "name": "sysId",
        "label": "Record SysID",
        "description": "Sysid of the current record",
        "fieldType": "string",
        "mandatory": false
    }
}

Change your data broker script to like below;

function transform(input){
var sysId=input.sysId;
var tableGr=new GlideRecord('your_table_name');
tableGr.get(sysId);
var gr= new GEMEditableVisibilityv2();
return gr.isIDNManagementPersona(tableGr.u_lcc_account);
}

If you add this data broker in the UI Builder page, it will ask you to provide sysId there map dynamically from the api.context.props.sysId
If my response helped, mark it as helpful and accept the solution.
Thanks,
Dinesh

View solution in original post

10 REPLIES 10

Hi @khareakshay ,

You can't call a Script Include directly from a UI Builder page. Instead, create a custom data broker that calls the Script Include (using the logic you already have in place), and then use that custom data broker within your page.

Refer to this video for guidance on creating a data broker: https://www.youtube.com/watch?v=4IXL7Ki2oxI

If you're still facing issues after following the video, feel free to post them here.


If my response helped, mark it as helpful and accept the solution.

Create a new transform data resource Developer Blog Post: https://developer.servicenow.com/blog.do?p=/post/quebec-ui-builder-data-resources/ Docs: https://docs.servicenow.com/bundle/quebec-application-development/page/administer/ui-builder/concept/data-resources.html

Hi @Dinesh Chilaka ,
I want to pass a field(u_lcc_account) available on the form to my script include. So what should I add in properties? Please refer the attached image

khareakshay_0-1785144246006.png

 

Hi @khareakshay ,
If you want to pass the value present in the form, pass the sys_id from the UI Builder Page and here in the data broker GlideRecord to that table and get the value of u_lcc_account value.
Copy paste the following in the properties field of the Data broker,

[
 {
        "name": "sysId",
        "label": "Record SysID",
        "description": "Sysid of the current record",
        "fieldType": "string",
        "mandatory": false
    }
}

Change your data broker script to like below;

function transform(input){
var sysId=input.sysId;
var tableGr=new GlideRecord('your_table_name');
tableGr.get(sysId);
var gr= new GEMEditableVisibilityv2();
return gr.isIDNManagementPersona(tableGr.u_lcc_account);
}

If you add this data broker in the UI Builder page, it will ask you to provide sysId there map dynamically from the api.context.props.sysId
If my response helped, mark it as helpful and accept the solution.
Thanks,
Dinesh

@Dinesh Chilaka Thanks for the solution, working as expected 🙂 

masonreed11
Giga Contributor

Have you checked the Workspace UI Builder? Custom visibility conditions for the Activity Stream email section are often configured there rather than on the form itself. Also look for related client state parameters or UI Builder scripts. If you can share the screenshot or your ServiceNow version, it'll be easier to point you to the exact location.v