Is it possible to write client script or BR on database view table

VIKAS MISHRA
Tera Contributor

I have merged few table including location table. now as per the below screenshot 3rd party team fetching all the information mentioned in this database view table along with country. 

I want to add one condition here in this table that if user is member of group "RSD" then instead of country code group name "RSD" should be visible in this table corresponding to that record. so that 3rd party team pick up that in integration . 

Please suggest if this is possbile.

 

VIKASMISHRA_0-1739239794108.png

 

VIKASMISHRA_1-1739239850479.png

 

1 ACCEPTED SOLUTION

Hi Vikas,

Please try below in the where clause for group member table

gm_user = us_sys_id and gm_group = "sys_id of group Regional service delievery"

Also you may need to check left join for sys_user view table

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

@VIKAS MISHRA 

3rd party is consuming endpoint to get database view table data.

Didn't understand this line

I want to add one condition here in this table that if user is member of group "RSD" then instead of country code group name "RSD" should be visible in this table corresponding to that record. so that 3rd party team pick up that in integration .

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi Ankur, 

Yes 3rd party consuming the endpoing to get database view table data. 

Condition is :

You can see for each record we have shown the country code of user's location.

3rd party team needs to perform some activity in their system for that they required identatification from Servicenow side , for eg if user is member of group "RSD" then they should perform one task irrespective of country code but is user is not member of that group then they will check the country code and perform one another activity .

Group membership will always be on priority means if user is member of that group then 3rd party team not concern about the country code ,

This is the reason I thought that if user is memevbr of that group then simply remove country code and populate "RSD" so that 3rd part will understand that this user is part of that gorup .

@VIKAS MISHRA 

Since it's a database view you cannot manipulate the data.

Whatever is present during the join will be available as it is when they consume the endpoint.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Gurpreet07
Mega Sage

Hi,  Alternatively you may be able to add sys_user_grmember table into the view and put a where clause as group name = "RSD" and user = user_sys_id .  Left join should be checked for existing tables.