Determine if a catalog item was loaded from the instance or portal

SanjenFibers
Tera Guru

I am sure there must be a question that covers this and I just don't know how to phrase the question when searching.  Feel free to direct me to another post if it already exists.

 

When a catalog item is initially loaded (i.e. at runtime), I need to be able to determine if the catalog item form was invoked from the native service catalog on the instance or from the service portal.  Is there a straight-forward way to determine this? I assume this would have to be determined from a client script as it is BEFORE submission.

 

Thanks,

JoeB.

1 ACCEPTED SOLUTION

Daniel Arnold
Tera Guru

To find out if a catalog item was ordered via the portal or not, follow these steps:

1. Create a checkbox variable on the catalog item (Example: ordered_via_portal).

2. Create a UI policy which simultaneously hides the checkbox and sets the value to true when in portal view. 

DanielArnold_0-1722371273426.png

 

DanielArnold_1-1722371309838.png

 

DanielArnold_2-1722371335551.png

Note: If you need this for multiple catalog items, you may capture this variable and UI policy in a variable set so it can be used multiple times.

View solution in original post

5 REPLIES 5

servicenow_devo
Tera Expert

Would you mind clarifying is this to see from where the catalog has opened or source ? Service catalogs usual submitted from portal and only belive it has try catalog builder feature.

Thankyou

I think he is trying to determine if the item was open from the Service Portal or from the fulfiller view (under self-service > Service Catalog.

Daniel Arnold
Tera Guru

To find out if a catalog item was ordered via the portal or not, follow these steps:

1. Create a checkbox variable on the catalog item (Example: ordered_via_portal).

2. Create a UI policy which simultaneously hides the checkbox and sets the value to true when in portal view. 

DanielArnold_0-1722371273426.png

 

DanielArnold_1-1722371309838.png

 

DanielArnold_2-1722371335551.png

Note: If you need this for multiple catalog items, you may capture this variable and UI policy in a variable set so it can be used multiple times.

Of course.   I actually did something very similar to this as part of a solution several years ago.  In our environment it is rare to have behavior that executes only in the portal - so I forget the option is available.

Thanks for the reminder