Do neighborhood user assignments break desk request forms?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 12:01 PM - edited 08-29-2023 12:36 PM
I'd like to use both neighborhoods and desk-request forms in their out-of-box setups, but there seems to be a conflict...
When I set up a user assignment rule and "Execute user assignments," an assignment record is created for every qualifying user. (So far, so good!) That assignment record needs to reference a workplace profile, so it either:
(A) attaches to the user's existing workplace profile (if they already have a desk)
(B) creates a workplace profile with "undefined" in the [workplace_location] field (if they don't have a desk yet)
When situation (B) occurs, that user can no longer use default forms like "Request a desk change." That "undefined" location is loaded into things like the "From location" fields, and the form fails because the location is invalid. Am I doing something wrong, or does this not work without some custom workaround?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 07:22 AM
ServiceNow Support is classifying this as an issue--PRB1697236, to be exact. (Shout out to Alec for the help on my case!)
It sounds like the ideal outcome for situation (B) is that new workplace profiles are created with no value in the [workplace_location] field (rather than "undefined"). I assume the underlying code will be updated as soon as possible. 🤞
For now, here's the workaround script you can use to correct records after they're created:
var userWorkplaceProfileGR = new GlideRecord('sn_wsd_core_workplace_profile');
userWorkplaceProfileGR.addEncodedQuery('workplace_location=undefined');
userWorkplaceProfileGR.query();
while (userWorkplaceProfileGR.next()) {
userWorkplaceProfileGR.workplace_location = 'NULL';
userWorkplaceProfileGR.update();
}