How to create a drop-down list for catalog item

pathat
Kilo Expert

Hello.

I want to present the user with a drop down list with names of groups (in a remote system) when the user goes to request a custom catalog item I created (called "Request Remote Access"). In the catalog item definition I see the different types of variables I can create like "Lookup Multiple Choice", and I have played around with this a little. Here's what I think I need to do:

1. Create a new table to hold the group names I want to display

2. Populate the table with names (i can manually enter names for now)

3. In the catalog item definition, select type "Lookup Multiple Choice"

4. In the catalog item definition, point to this new table

5. Find a way to populate the table with values retrieved in real-time from an external system (using a scheduled web service that calls to it).


At this point, the user should be able to select the group name from a list displayed in the request form, instead of having to type it in (that's how it works now): Am I on the right track, or is there a better way to do this? Also, let me know if you've tried or know how to populate the table with a web service.


Thx!

13 REPLIES 13

Hi Pat, if it's just for holding group names perhaps it's not meaningful to extend it from other tables and it is OK to keep it as a table by itself. You will like to extend from a table on the situation where you want all the properties from the extended table and add have some more fields on it, which doesn't seem to be the case for you.



If you will like your groups to have all the properties of the sys_user_group table and have similar behavior as to any other group in the system, then I will actually suggest that you leverage that table instead. If needed you create a new type field to differentiate your groups from others (only if this is needed).



Thanks,


Berny


Thx Berny. I'm learning something new about SN everyday. It's got lots of features I have yet to discover and try


I am now looking at creating a scheduled job to run a custom script which will populate the new table I created with one column called 'Group name'. I created the job and ran it now but no output seen yet. I added gs.addInfoMessage() statements to debug. I expected to see the debug output in the same window I executed the script. I'll continue to tinker with this.


Hello Pat, not very recommended but you can use gs.log() to debug the script.



I would recommend you to copy the script on the scheduled job, an then go to Background Scripts and run it from there. You can add gs.print() statements, it will make debugging to much easier.



Thanks


I see. Well, I hope all this comments are helpful



One additional comment, you may want to log your debugging statements using a gs.log instead of a gs.addInfoMessage. That way you can refer at   to past logs at System Logs >> System Log >> All >> Script Log Statements at any point and know what was the output at which time. You can also take a look to the warning and error logs in case something is failing.



Thanks,


Berny


bernyalvarado
Mega Sage

Hi Pat, would you agree we're good to close this thread? If so, I will appreciate if you can mark any of the questions as helpful/correct so that we can close this thread.



Thanks,


Berny