The CreatorCon Call for Content is officially open! Get started here.

Prevent insert of record(s) in table during data load

Mo27
Kilo Expert

Hi there,

I have an issue where during data load using an excel doc to a staging table, if additional columns/miss spent columns are included within excel doc, it will create a new system dictionary entry and column within the staging table. I wish to restrict certain users from being able to do this during a data load. 

I have checked the ACL - create and write on sys_dictionary and its able to bypass the required role(s). 

Is it possible to a create a business rule to run before insert on sys_dictionary to check if the user has a certain role and also, passed the write ACL on sys_dictionary to insert the data in the table? If so, how is this possible? 

Please can you provide me with examples if you have any or any articles.

 

Thank you 

1 ACCEPTED SOLUTION

Michael Kaufman
Giga Guru

It's a global setting, but you could turn it off temporarily when you want to do a new import:

System Property: glide.import_set_row.dynamically_add_fields

Specifies whether an import set can add new columns to the staging table (true) or not (false). Instances that contain large numbers of import sets can sometimes become unresponsive when an import adds a column because the instance must alter every row in the staging table. In some cases, the database alter table action causes an outage. Setting this property to false prevents an import set from adding columns to the staging table and produces a log message. As a workaround, administrators can manually add a column to the staging table by creating a new dictionary entry and then reimporting the import set.

https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/import-sets/refer...

View solution in original post

9 REPLIES 9

Dubz
Mega Sage

Does it matter if erroneous fields are added to a staging table? They won't be inserted into an actual table as they won't be dynamically added to a transform map so it might look a bit messy on the staging table but a staging table is just a staging table, i don't think i've ever actually opened a staging record before...?!

Yes I understand, it was a requirement to restrict this but it cannot be done. 

one option would be to restrict access to import sets, only allow it to people who can be trusted to input good data. then, if they don't at least you know who was responsible and that they should have known better 🙂

hahaha yes that has been done already, but they still manage to make mistakes.. 

I tried creating a business rule to abort insert before insert on sys_dictionary but it seems that data load somewhere sets workflow to false so it doesnt evaluate any acls n BRs etc...

Anish Reghu
Kilo Sage

Restrict it via DATA Policy.