Automate custom property fill in


I would like to somehow automate custom property fill in for nodes in our NPM. We are using standardized names for devices so we would like to set it up that it will search for it is name and assign custom property to match it.

I know it is possible to set custom property for node name with alert but our situation is little bit more complex. We have custom properties responsible for network device type and it is location.

Meaning that if i would like to automate it for location i would need to make alerts for each location we have but I would like to avoid that as we can have location name in device name, so i would like to use that.