Skip to content
snhackery

Adventures in mangling the ServiceNow platform

  snhackery
  • Home
  • About
  • Disclaimer
  • Update Sets

Service Account Management, Part XVIII

Posted on March 7, 2023 | by snhackery

“On your darkest days do not try to see the end of the tunnel by looking far ahead. Focus only on where you are right now. Then carefully take one step at a time, by placing just one foot in front of the other. Before you know it, you will turn that corner.”
— Anthon St. Maarten

Last time, we threw together the beginnings of a configuration script for Service Account dashboard using the Content Selector Configuration Editor. Now that we have a viable script, we need to create Service Portal Page that will utilize that configuration. To begin, we will pull up the list of Portal Pages and click on the New button to create a new page.

New Service Portal Page

We will call our new page Service Account Dashboard and give it an ID of service_account_dashboard. Once we submit the form we can pull it back up and use the link down at the bottom of the form to bring it up in Service Portal Designer. Onto the blank canvas we will drag a 12-wide container, and beneath that one, we will drag in a 3/9 container. Into the upper 12-wide container, we will drag in the Dynamic Service Portal Breadcrumbs widget, and into the 3 portion of the 3/9 container, we will drag in the Content Selector widget. In the 9 portion of the 3/9 container, we will pull in the SNH Data Table from URL Definition widget. Now that we have placed all of the widgets, we will need to edit them, starting with the Content Selector.

Configuring the Content Selector widget

Here is where we enter the full name of the configuration script that we created last time. Since this is a Scoped application, we need to include the scope with the name so that it can be successfully located. That’s all there is to configuring that widget, as most of the configuration information is contained in the referenced script. Configuring the Data Table widget is a little more involved.

Configuring the Data Table widget

Here we give it a title of Service Accounts and select an appropriate Glyph image. We check the Use Instance Title checkbox to get our title to show up, and we leave all of the rest of them unchecked. Once we save that and save the page, we should be ready to try it out, which we can do easily enough with the View page in new tab button up in the upper right-hand corner.

Active Service Accounts

So far, so good. The default selection is active Service Accounts from the requester’s perspective, and you can see all of the account records from our failed and successful test submissions. I went ahead and retired one of them so that we could test the Retired state. Let’s click on the Retired button and see how that comes out.

Retired Service Accounts

That looks good as well. Now let’s try the Pending state, which should come up empty for the Service Account table, as pending requests have not gotten far enough along in the process to have created the record in that table yet.

Pending Service Accounts

Well, that’s not right! But you knew things were going too well at this point and it was about time for something to go horribly wrong. This is just a problem with our Filter, though, and should be easily remedied. We used the filter 1=0, which obviously did not work, so let’s try using an actual field from the table and do something like this in our config file:

filter: 'number=0',

Before we add that to all of the pending configurations, let’s pull up the dashboard again and see how that looks.

Pending Service Accounts, corrected

That’s better. Of course, to actually see the pending Service Accounts, we will need to add another table to our configuration. We can go back into the Content Selector Configuration Editor to do that, and then go back to the dashboard and check it out. That sounds like a good exercise for our next installment.

Share this:

  • Click to print (Opens in new window) Print
  • More
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Pocket
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Tweet
  • Share on Tumblr
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to email a link to a friend (Opens in new window) Email

Like this:

Like Loading...
Posted in Projects | Tagged Breadcrumbs, Content Selector, Data Table Widget, Portal Page, Service Account, Service Portal, Service Portal Designer

Post navigation

Service Account Management, Part XVII
Content Selector Configuration Editor, Corrected (again)

Recent Posts

  • Periodic Review, Part XI
  • Periodic Review, Part X
  • Periodic Review, Part IX
  • Periodic Review, Part VIII
  • Periodic Review, Part VII

Recent Comments

  • snhackery on Service Account Management, Part XVI
  • Jennifer Schoenhoeft on Service Account Management, Part XVI
  • snhackery on Service Portal Form Fields, Broken
  • Joe Blogs on Service Portal Form Fields, Broken
  • Joe Blogs on Service Portal Form Fields, Broken

Archives

  • February 2024
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018

Categories

  • Cool Stuff
  • Discoveries
  • General
  • Hackery
  • Projects

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Subscribe to snhackery via Email

Enter your email address to subscribe to snhackery and receive notifications of new posts by email.

Useful ServiceNow links:
Main web site: https://servicenow.com
Developer site: https://developer.servicenow.com
Annual Conference:   https://knowledge.servicenow.com
%d