Best approach to display and use Store Codes from cmn_location in Catalog variables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited an hour ago
Hello Community,
I have a Catalog Item with:
a Reference variable to cmn_location for the Primary Store;
a List Collector on cmn_location for Additional Store Visibility.
Both variables use a dynamic Reference Qualifier to filter the available locations based on the Requested For user.
This Catalog Item is used to create user accounts in a third-party application, which requires the Store Code to be sent through an API.
The display field of cmn_location table is name, while the Store Code required by our business process and external API is stored in the custom string field u_store_code.
Using ref_ac_columns, I can display the Store Code while searching for a location. However, once a location is selected, only the location name is displayed, both before submission (on the Service Portal form) and after submission (in the approval view and Catalog Task variables).
We need to be able see the Store Code to validate the request, and the integration must also retrieve the corresponding Store Codes to send them to the external API.
I identified two possible solutions:
Change the display field of cmn_location to u_store_code, but this would affect every reference to the Location table.
Use a client-callable Script Include and Catalog Client Scripts, along with an additional read-only variable to store and display the Store Code. This works, including dynamically updating the Store Code when the user changes the selected location. However, the same requirement may apply to several Catalog Items, and I would like to avoid duplicating this logic.
For the List Collector, the displayed Store Codes should also update dynamically whenever locations are added or removed.
Is there a more standard or reusable approach for this use case?
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
53m ago
Hello @Jonathan Rousse
Use a Lookup Select Box instead of the Reference variable. It lets you choose what is stored and what is displayed on the variable itself, so the table display field stays untouched.
- Create the variable with the type Lookup Select Box.
- Set Lookup from table to cmn_location. Set Lookup value field and Lookup label field(s) as shown in the screenshot, where I used city and name as an example. Any field can be used here, and the label accepts a comma separated list. In your case, use u_store_code as the value (or Sys ID if you prefer) and u_store_code, name as the label.
- Add your existing dynamic filter in the reference qualifier, based on the Requested For variable.
Hope this helps!
Thank You!
Juhi Poddar
Juhi Poddar
