Pattern extension - Adding fields to table already populated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2020 12:57 PM
Hello everyone,
We have created a pattern extension for routers to make some customization. Basically we are trying to get the description from the device's interfaces and populate the field "short_description" in table "dscy_router_interface". Since that table has already been populated by the OOB pattern we only need to add the values for that specific field but haven't found a way to do it.
We only need to add the description and don't want to wipe out the current content of the table because there are already relations with other tables.
Is there a way to iterate through that table and assign to each router interface the correct description based on the interface index (that index works as the identifier of the interface)?
Thanks in advance for the help!
- Labels:
-
Discovery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2020 09:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 07:02 PM
Thanks for the info Ashutosh, but the actual issue is with the logic behind actually populating the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2020 07:43 PM
We only need to add the description and don't want to wipe out the current content of the table because there are already relations with other tables
Possible Solutions:
use java script approach access all records in tabled scy_router_interface and update short description by iterating.
OR
Fetch router_interface records and update shot description.
Save values into temporary table.
Later do union of temporary table and dscy_router_interface.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2020 06:59 PM
Hello Venky,
Thanks for the answer. How are cmdb tables referenced from the javascript code? I'm trying to iterate using a "set parameter value" step in combination with "eval()", however I haven't found a way to directly reference and modify the "dscy_router_interface[].short_description" field while looping.
I tried something like this but is not working:
for(i=0; i<${dscy_router_interface}.size(); i++){
${dscy_router_interface[i].short_description} = ${if_alias_table[i].ifAlias};
}
where:
- ${dscy_router_interface} is the target table
- ${if_alias_table} is a merged table that contains the description I need
What am I missing?
Thanks!