How do I assign manager to a user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2022 04:32 AM
Hi All,
I have a table which is similar to user table. Let's name it as u_accounts.
It has some fields
user_id
first_name
last_name
Manager
Manager Identity-(Reference to itself i.e u_accounts) - Hidden on form
Manager user Id -String-hidden on form
Now Manager is function field where using Manager identity I am getting its name and user_id and appending them and displaying it on form.
The records are imported from an excel sheet which contains
user_id,first_name,last_name,manager_user_id . Now after records are imported I want to lookup in the same table for records and search using manager_user_id and assign that in Manager Identity.
We cannot use after business rule as suppose a manager record is after the user records in that case it won't find the manager and it will not work.
How can I implement this any suggestions?
I want it to work even when data is coming from integration or import
- Labels:
-
Architect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2022 12:40 AM
I'd use a Scheduled job to check the new users it daily then assign those empty manager fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2022 03:37 AM
Hi,
Please use background script (use the logic specified in your post to assign a manager for each record imported) post importing the data successfully into your custom accounts table.
I trust you might have evaluated before creating custom table to accommodate user related data. Ideally, it is not recommended to create a copy to sys_user table. Suggest you to re-assess the situation and create, or follow business smart customizations recommended by ServiceNow to arrive at informed decisions.
Best Wishes, Uday Damaraju