Populate stack name with a script
-
- UpdatedFeb 1, 2024
- 4 minutes to read
- Washington DC
- Cloud Management
This example illustrates how to populate the name of the stack that a user requests from the Cloud Provisioning and Governance catalog by utilizing the user's ID. The example uses a script include that you can call from a blueprint rule action.
Before you begin
Role required: sn_cmp.cloud_service_designer
This example uses a script include. If you want to create similar script includes, familiarize yourself with the Glide System APIs that are part of your instance. See the Developer site for a comprehensive list of all APIs. See Script Includes for more information about how the system uses these scripts.
About this task
The goal of this example is to take the ID of the catalog requester and populate it in the Stack Name field. The field remains editable. Follow an example like this one when you want to loosely enforce a naming or labeling convention on certain values, but still allow the user to enter the text that they want.
Procedure
Result
In the Cloud User Portal, the catalog order form for the Provision operation shows the user ID of the logged-in user. This example uses the user Able Tutor, which comes in the base system as demo data. The value in the Stack Name field is the same value as in the User ID field on the User [sys_user] table. The profile icon for the same logged in user is also displayed in the upper right of the Cloud User Portal.