How to set default value of variable in RP to a field value in a table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2023 07:38 AM
Hi all,
I have a use case to set the default value of 5 variables in a record producer. the default value should be set to the value of the existing records, which are stored in a table. So basically I need to query a certain table, get the value of field x and use that as default value.
How can I do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2023 09:10 AM
You'll need to create an onLoad Catalog Client Script that Applies on a Catalog Item view. This script will use GlideAjax to call a Script Include to do the querying and return the values. The client script will then set the Catalog Item variables to the values returned by the SI. Here's an excellent guide if you're not familiar:
Give it a shot and post your scripts using the insert code icon (</>) if you get stuck.