Sumit Pandey1
Kilo Guru
Kilo Guru

Assume a scenario, a customer asks you to design a catalog item, the requirements are - A new form called "XYZ Access" and form fields should be -

  • Requested for - reference field
  • Request type - choice field with 6 choices
  • User profile - choice field with 10 choices
  • Additional notes - multi line text

You developed the form and migrated to production, now the same customer reached out to you and asks to add 2 more choices to the 'User profile' field. Since your 'User profile', field is a select box with static choices, modifying that directly on production would not be recommended so you create an update set on dev, add the choices, capture in update set and migrate to prod... fine! 3 weeks pass by and the customer comes back asking to remove 2 options from the 'User profile' field... you take a deep breath, create the update set on dev and repeat the same process again... this is tiring and you wish is there a way out of this?

Yes there is!

Instead of creating dropdown fields with static choices, use lookup select box or reference field. Now the second question would be, where am I going to store all these values so that I can reference them?

Create a new table called - "Catalog Item Options" (*custom tables have cost associated) Add fields - Active (true/false), Catalog Item (reference to the catalog item), Display Value (single line text), Variable (reference to variables table)

It will look something like this -

CatalogItemOptions.png

Once you have the table and all the values in it, instead of defining static choices, reference the choices from this table.

FilterConditions.png

Now you don't have to worry about adding/removing choices, adding choices would be as simple as adding new records in the catalog item option table and to remove choices just uncheck the active field, and since this is just modifying data, you can do it directly on production.

And even better, you can provide the access to this table to the customers so they themselves can maintain these values and won't have to reach out to you.

You can use this table to store reference values for all of your catalog items and not just catalog items, think about how you can extend the use of this table. For any of the reference field or list fields where you don't have any existing table to reference the values from, you can use this table to store the values and reference this table for all those fields.

Note - If you have any alternative approach or any feedback at all, please let me know in comments.

Comments
Gaurav Shirsat
Mega Sage

Hello

@Sumit Pandey Indeed this looks super cool. haven't tried this YET on PDI.

Only one concern I would like to discuss here is, when we order catalog item via virtual agent, this lookup select box did not perform well.

so, its my opinion  on this is if a customer is planning to facilitate this catalog item through virtual agent, then they still want to go by older procedure.

You can read out the technical difficulty in one of my question:- 

https://community.servicenow.com/community?id=community_question&sys_id=9bec7405db86fc10e2adc2230596190d

also you can check the entire functionality I have developed in Virtual Agent in below Article:- 

https://community.servicenow.com/community?id=community_article&sys_id=cc22fcf0db64c190be625ac2ca961...

Nice Article.

will definitely try this out today.

Mark my Response as Correct or Helpful, if you find it Appropriate.
Gaurav Shirsat
https://www.linkedin.com/in/gauravshirsat/

Sumit Pandey1
Kilo Guru
Kilo Guru

Thankyou Gaurav for highlighting this, I think instead of lookup select box, we could always use reference fields as functionally they both work the same but reference field are better for performance.

Version history
Last update:
‎12-25-2021 07:04 PM
Updated by: