- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 02:32 AM
I created a record producer for cmdb_ci_server[Server] table, in which I created 2 variables and 1 variable set.
I want to map these variables & variableSet's variables to cmbd_ci_server[Server] tables fields.
I want answers to the following questions:
1) How can we map variableSet's variables without writing script? (if there is a no-code approach).
2) How to access variableSet's variables in script? (ie.. we access normal variables like "producer.<variable_name>").
3) Which is the most optimized way of mapping record producers variables with target table fields? (manual mapping or scripting)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 12:44 AM
We can access variableSet's varibales like: producer.<variableSet_name>.<varibale_name>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 04:29 AM
There are two type of Variable Sets - single row, and multi row. With both, there is not a no-code method to map the variables to a field. In your producer Script, for a single row variable set, treat it as you would any other variable with the syntax
current.field_name = producer.variable_name;
A multi-row variable set requires a few more lines as you have to loop through the value for each row, so let me know if that's what you're dealing with, then you have to decide how you want to handle the mapping of multiple values to a single value field.
For variables outside of a variable set, it's always best to use the non-scripting method if it's a basic mapping with no lookup/manipulation needed as you are selecting the field by name rather than typing in the field name and variable name, so there's less room for error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2022 04:35 AM
yes! I want to access variableSet's variable. how can we access them in record producer scripts.
rest was helpful!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 12:44 AM
We can access variableSet's varibales like: producer.<variableSet_name>.<varibale_name>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 02:32 AM
And how can we access variable set's > variable using catalog client script in catalog iten.