Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Script doesn’t update variable

Solved821 views23rd March 2022Automation Visual Overview
0
Robin Becker [DevOps Advocate]1.40K 22nd March 2022 0 Comments

I have two scripts that are run from a Visual Overview:

  • One that reads 5 different values from a memory file and populates 5 different Card Variables (this is executed automatically when the card is opened)
  • One that sets a new value to one of the memory file positions and updates the corresponding Card Variable (this is executed by clicking a shape)

Both scripts work fine except that after setting a new value in the memory file in the second script its corresponding Card Variable is never updated (but if I close the card and reopen it the new, correct value is shown). I've made sure that the Option field is set to CardVariable on the shape that executes the second script as well as on the page level for the first script. I even tried running the first script again as a sub-script in the end of the second script with the InheritScriptOutput SubScriptOption without success.

This is the second script:

 string liveId = (string) engine.GetScriptParam("liveId").Value;

// create a UI that will display a line of text and a textbox
UIBuilder uib = new UIBuilder();
uib.AppendLine($"Configure source for {liveId}:");

var elementSDNOVideo = engine.GetDummy("elementSDNOVideo");
var tableKeys = elementSDNOVideo.GetTableDisplayKeys(800);
Array.Sort(tableKeys);
var inputs = tableKeys.Select(input => $"{input}|{input}").ToArray();

uib.AppendDropDown("opt", inputs);
uib.AppendButton("btn", "SET");

// show the UI and wait for a response
UIResults uir = engine.ShowUI(uib);

if(uir.WasButtonPressed("btn")) {
string selectedInput = uir.GetString("opt");
var inputIndex = (string) elementSDNOVideo.GetParameter(801, selectedInput);

ScriptMemory memoryFile = engine.GetMemory("LivePanel");
memoryFile.Set(Int32.Parse(liveId), inputIndex);

engine.AddOrUpdateScriptOutput(UIVariables.VisualOverview.CreateKey($"LiveSource{liveId}"), inputIndex);
}

Robin Becker [DevOps Advocate] Selected answer as best 23rd March 2022

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
Jens Vandewalle [SLC] [DevOps Enabler]9.44K Posted 23rd March 2022 3 Comments

Hi Robin,

It's not possible from an Interactive Automation Scripts to update a variable on a Visual Overview. There is task DCP180165 which will make this available.

As a workaround you can use following flow:

  • Launch not interactive script when user click on button
  • Launch interactive subscript which will return the variable value to its parent script
  • Parent script will try to set the value to a variable on the visual

Parent script

Subscript

First you need to link this script to your user

Afterwards you can send the variable back to the parent script

Robin Becker [DevOps Advocate] Posted new comment 23rd March 2022
Robin Becker [DevOps Advocate] commented 23rd March 2022

Thank you, this worked! I did replace the first “foreach” with “subscriptOptions.InheritScriptOutput = true;”
and I skipped the AddResource method (just used engine.AddScriptOutput in the subscript), still worked. Are there any unforeseen consequences of me skipping those parts?

Jens Vandewalle [SLC] [DevOps Enabler] commented 23rd March 2022

The InheritScriptOutput property is by default true, so not mentioning it shouldn’t make any difference.
I don’t understand the last changes that you did. I can understand that you don’t use the AddResource method since this is a copy-paste from a script of my own 🙂 But I guess that you are still using method Add(OrUpdate)ScriptOutput in your subscript and in your parent script? If that’s the case then all should be fine.

Robin Becker [DevOps Advocate] commented 23rd March 2022

I only use AddScriptOutput in the subscript and it works. Using it in the parent as well will cause it to throw an error saying the Key already exists.

You are viewing 1 out of 1 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 Votes
When using the Setter = true attribute, will the copy action always be executed first? 1 Answer | 2 Votes
Multiple Set on Table parameters for DVE’s 1 Answer | 2 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (69) Correlation rule (52) Cube (150) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin