Unique Field - Did You Know
foreign Chuck here with another quick tip for admins and developers to be more effective on the servicenow platform but first that familiar reminder to click like if you find this helpful and subscribe so you don't miss any great content in the future okay here's the problem we're trying to solve this time we want to ensure that this ID field is unique this could be any string field like a serial number tracking number or something that you want to make absolutely sure that there's no duplicates on this table one method would be to create a script and check before the record is saved but that's something we would need to write and maintain ourselves did you know the system already has a way to do this automatically all we have to do to set this up is check a box on the fields dictionary entry let's have a look we'll start out by right clicking on the field label for this field and choosing configure dictionary the dictionary contains a field called unique but unfortunately it's not on the default form layout nor the advanced View and just to prove it's really there we'll take a look at show XML and we can see it's set to false now we could go and configure the form layout for the dictionary entry to include the unique field but that might cause some issues with other admins and developers on our system so let's go back and use the form menu to select configure table next we'll personalize the list columns in this embedded list to display the unique field all we need to do is set the value to true now when we go back to our list of records and create a new record look at what happens when we try to save a record that has the same ID as an existing record in the table the system tells us that this is a duplicate entry on the ID field and the record was not saved there you go use the unique field when you want to ensure unique values across records in a table and don't forget if you've got an idea or a tip about the platform an app or capability use the hashtag servicenowdyk in your video blog or social media to be part of the community I'll be back soon with another servicenow Dyk thanks for watching [Music]
https://www.youtube.com/watch?v=vecNzPvkuj0