Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Can we do GlideRecord or ACL Restriction on the Database View Record?

Not applicable

Hi Team,

 

Can we do GlideRecord to the Database view records so that i can copy and paste the record to the custom table? Or Can we write ACL restriction to the Database View Records?

 

Please check and provide your inputs.

 

@Ankur Bawiskar - Please provide your inputs for the above mentioned point.

14 REPLIES 14

Not applicable

Not write we want to create a Read ACL on the database view to restrict the risk data based on the entity Risk Champion and Division Director.

 

SohamTipnis
Mega Sage

Hi @Community Alums ,

 

Yes, we can use GlideRecord to database view.

You can refer to this video:

https://www.youtube.com/watch?v=_JY462TmXxU

 

If you find my answer useful, please mark it as Helpful and Correct ‌😊


Regards,
Soham Tipnis
ServiceNow Developer ||  Technical Consultant
LinkedIn: www.linkedin.com/in/sohamtipnis10

ServiceNow database views on reporting This interview is for up to 3 years experience candidate to touch how the questions will be raised and what the interview expects. #howto #workassignment #learningcoding #coding #servicenow #hiring #jobs #jobsearch #jobvacancy #jobvacancies #google #accenture

yashkamde
Mega Sage

Hello @Community Alums ,
Yes It's totally fine to use GlideRecord API on Database views.

There won't be any negative impacts.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0855795 

 

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

its_SumitNow
Mega Sage

Yes, you can absolutely perform a `GlideRecord` query against a database view. A database view in ServiceNow is essentially a read-only table, a dynamic join of other tables, that can be queried just like any standard table. You can instantiate `GlideRecord` with the name of the database view as the parameter. Once you have the `GlideRecord` object populated with data from the view, you can iterate through the results and use the retrieved values to populate and insert new records into your target custom table. This is a common and valid integration pattern for data syndication or transformation within the platform.

Regarding your second query, Access Control Lists (ACLs) can indeed be applied to database views. When you create an ACL, you specify the object it applies to, which can be a table or a database view. You can create `read` ACLs on the database view's name (e.g., `u_my_database_view`) to control which roles or conditions permit a user to see the records within that view. The system will evaluate these ACLs at runtime whenever a query is made against the view, enforcing the security constraints you've defined. This allows for granular control over the visibility of the joined data presented by the view, without altering the permissions on the underlying source tables.

 

If my response helped, kindly mark it as helpful & Accept it as Solution 🙂

Regards

Sumit

Technical Consultant

Not applicable

Hi Sumit,

 

Thanks for the response. Whenever am trying to create a new Read ACL on the database view, unable to select my database view in the name column. Please check and provide your inputs.