- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2025 09:45 AM
We have a business rule that automatically generates asset tags for assets.
When adding an asset through the form, the numbers generate correctly. However, when bulk-loading assets using an Excel sheet, the business rule sometimes doesn’t trigger, or it generates duplicate asset tag numbers.
It seems that the transform map is not correctly recognizing the database operations.
Has anyone encountered a similar issue or have any suggestions?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2025 07:29 AM
Hello @mankali_kal ,
By any chance, are your asset tags following a fixed pattern, e.g. a prefix like "ASSET" followed by an incrementing number?
If that is the case you could simply use the built in auto numbering feature.
Step 1: go to Number Maintenance and create a new entry for the Asset table. Define a prefix and the number of digits.
Step 2: in the Dictionary record for the asset_tag field, set the default value configuration as shown below:
Step 3: disable your custom Business Rule
Result: ServiceNow will take care of assigning unique numbers automatically
If for some reason you do not want to enable this feature and the suggestions provided by @Robbie don't work out please provide a screen shot of the Business Rule script (I assume it's configured to run BEFORE INSERT?) and, if your Excel upload uses Transform Map scripts, share those as well.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2025 04:18 AM
Helllo @Robert H ,
Thanks for your response,
I’m not currently aware of any risks associated with using the numbering system. Do you foresee any potential concerns?
My requirement is to bulk load asset information, automatically generate asset tags, and send a response back to the requester with the generated tag numbers.
If there are no identified risks with this numbering approach, I’m comfortable proceeding, as it would meet the requirement effectively.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2025 05:20 AM
I would like to mention that we are working in domain seperated instance. Numbering system seems to be a global configuration. Any alternative to achieve this in domain specific instance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2025 05:47 AM
Hello @mankali_kal ,
I'm not seeing any conflict in using the built-in numbering feature together with domain separation. Many applications, like Incident Management, use this feature and at the same time support domain separation.
But, as with all changes, this should be tested thoroughly in a non-production environment to make sure there are no undesired side effects.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2025 11:47 PM
Hi @Robert H ,
I tried the number maintenance concept and applied it to asset_tag attribute. But it seems like everytime a number is skipped while bulk loading the data.
attached the screenshot for reference. I checked deleted records and did not find anything. Tried loading the data multiple times but the same behavior everytime.
Please assist.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2025 10:47 PM
Hello @mankali_kal ,
There are several reasons why this might happen.
For example, by default numbers are also assigned if you just initialize a new record without saving it to the database, see here. There is a System Property "glide.itil.assign.number.on.insert" that you could try setting to "true", but please note that this has a global impact on all tables that use auto numbering.
You also mentioned earlier that this is a domain separated instance, so it could be that someone created an asset with ASTG0001049 in domain A, then someone else created an asset in domain B, so the next asset in domain A got the number ASTG0001051.
Try creating a few assets manually very quickly. If there are no gaps in the numbering then your bulk import is the reason for what you observed.
Regards,
Robert