Hello,
I'm very new to writing scripts so maybe I miss some basics here but I am trying to write a simple script to change an output state of a Power device unit.
The unit uses Generic SNMP and has a parameter table.
My problem is that I get the parameter <index>field but there is no dropdown list that appears and it's also not possible to add some characters ...? When clicking on <index> nothing happens ...?
I tried to use another parameter (not a table parameter) like add parameter name or delete one and that works fine.
So how come that the <index> field remains red colored and doesn't show a dropdown list of possible values (indexes) ?
Grts
Dirk
The reason there is no dropdown with possible values is because the parameter set is bound to your script dummy. A script dummy is basically an element of a specific protocol that is still to be chosen when you execute the script.
Now I realize that you can select a "configuration element" in your dummy, but all a configuration element does is allow you to use that element's protocol for the rest of your script. The actual element selection can still change when you actually execute the script.
However, when you do select a configuration element and that configuration element has entries for your table, your index dropdown will be populated with the keys from that table.
If you don't select a configuration element, we can't show you a list of possible table entries as the entries can be different for every element. At that point you'll have to enter a key manually.
In any case you have to enter a key as we also can't set the parameter without knowing what table row to set it on.
Lastly there are several reasons why we always allow you to enter an index manually:
- For when your selected element changes or is entered upon script execution, as mentioned above.
- Tables are volatile, meaning a key that doesn't exist now might exist when you execute the script.
- Copy pasting a value from a table cell can be useful.
Hope that helps, let me know if you have further questions.