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
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • 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
    • 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
    • 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
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Can you pass data between automation scripts?

Solved1.26K views18th November 2021Automation
2
Jochen Dewachter [SLC] [DevOps Advocate]2.16K 18th November 2021 0 Comments

When I have an automation script that launches another sub automation script, can I pass/return data from my sub script to my ‘parent’ script? E.g. in case there’s an exception in the subscript.

Michiel Vanthuyne [SLC] [DevOps Enabler] Answered question 18th November 2021

4 Answers

  • Active
  • Voted
  • Newest
  • Oldest
9
Mieke Dryepondt [SLC] [DevOps Advocate]3.60K Posted 18th November 2021 2 Comments

Hi Jochen, when running an automation script as subscript you can return data to the main script via the AddScriptOutput.

Here an example of how I use it:
Subscript:
// Add data to be returned to main script.
engine.AddScriptOutput(“PlmStorageJson”, storageJson);
engine.AddScriptOutput(“PlmError”, error);

Mainscript:
var scriptOptions = _engine.PrepareSubScript(“SLC_DOM Get Storage Data”);
…
scriptOptions.StartScript();
Dictionary<string, string> result = scriptOptions.GetScriptResult();
string plmError = string.Empty;
string plmStorageJson = string.Empty;
result.TryGetValue(“PlmError”, out plmError);
result.TryGetValue(“PlmStorageJson”, out plmStorageJson);

Joey Vanhalst [SLC] [DevOps Advocate] Posted new comment 19th November 2021
Jochen Dewachter [SLC] [DevOps Advocate] commented 18th November 2021

Exactly what I needed, thanks!

Joey Vanhalst [SLC] [DevOps Advocate] commented 19th November 2021

A video explaining this is also available in the Automation course: https://community.dataminer.services/lessons/subscript-results/

2
Matthias Declerck [SLC] [DevOps Advocate]2.75K Posted 18th November 2021 0 Comments

Hi,

To emphasize the answer of Mieke:
A request is sent to the server for starting an Automation script.
When that script is finished/completed, then a response is sent back, namely ‘ExecuteScriptResponseMessage’.
Such response message has a property called ‘ScriptOutput’:

So it can not only used for communications between scripts, but it can also be used to communicate to the ‘executioner’ of the script.
Otherwise said: you can actually use scripts now as functions: you start with given arguments (dummies, parameters, memory files) and you end with return values.
A nice example in Cube is the ‘Automation script session variables’ feature (RN 27895).

Matthias Declerck [SLC] [DevOps Advocate] Answered question 18th November 2021
1
Michiel Vanthuyne [SLC] [DevOps Enabler]4.16K Posted 18th November 2021 0 Comments

If both scripts would need to be started from a visual overview, it is also possible to store the info in session variables by using the “AddScriptOutput” function like this:

engine.AddScriptOutput(UIVariables.VisualOverview.CreateKey(“MyOutput”), “myValue”);

Michiel Vanthuyne [SLC] [DevOps Enabler] Answered question 18th November 2021
0
Ben Vandenberghe [SLC] [DevOps Enabler]9.06K Posted 18th November 2021 0 Comments

That’s typically done by using a ‘memory’ in Automation I believe, where you store data with one script and access it with another.  Or are there other ways?

Ben Vandenberghe [SLC] [DevOps Enabler] Answered question 18th November 2021
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
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