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

How to access DOM instance field value from automation script

Solved1.26K views17th October 2022automation scripts DOM
0
Gerwin van der Kamp [DevOps Enabler]2.91K 14th October 2022 0 Comments

Hi,

I'm trying to get information of an DOM instance from an automation script. I'll trigger that script through an low code app and pass the guid of the instance i need to open in the automation script.
Looking at the examples on https://docs.dataminer.services/user-guide/Advanced_Modules/DOM/DOM_examples/DOM_status_system_example.html

there mainly focused on creating and updating fields, but little to no information about reading the information based on having an valid instance guid.

Jens Vandewalle [SLC] [DevOps Enabler] Answered question 14th October 2022

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
4
Jens Vandewalle [SLC] [DevOps Enabler]9.44K Posted 14th October 2022 1 Comment

Hi Gerwin,

Below some code examples in case the script is executed from a DOM button in a Low code app.

Load basics

var instanceId = context.ContextId as DomInstanceId;
var domHelper = new DomHelper(engine.SendSLNetMessages, instanceId.ModuleId);
DomInstance domInstance = GetDomInstance(domHelper, instanceId);

private static DomInstance GetDomInstance(DomHelper domHelper, DomInstanceId instanceId)
{
FilterElement<DomInstance> domInstanceFilter = DomInstanceExposers.Id.Equal(instanceId);

List<DomInstance> domInstances = domHelper.DomInstances.Read(domInstanceFilter);
domHelper.StitchDomInstances(domInstances);

return domInstances.First();
}

Go through Sections > FieldValues and store the data in an object

foreach (var section in domInstance.Sections)
{
foreach (var fieldValue in section.FieldValues)
{
var fieldDescriptor = fieldValue.GetFieldDescriptor();
switch (fieldDescriptor.Name)
{
case "Field Descriptor Name":
data.Name = Convert.ToString(fieldValue.Value.Value);
break;

default:

break;
}
}
}

Jens Vandewalle [SLC] [DevOps Enabler] Answered question 14th October 2022
Gerwin van der Kamp commented 17th October 2022

Took some fiddeling but it does work 🙂 thanks!

1
Michiel Clepkens [SLC] [DevOps Advocate]1.25K Posted 14th October 2022 0 Comments

Hi Gerwin

Retrieving FieldValues from a DOM instance can be done using the following steps:

  1. Create an object of the DomHelper class (DomHelper class | DataMiner Docs)
  2. Create a filter to find the right DOM instance in the collection of instances

    Skyline.DataMiner.Net.Messages.SLDataGateway. ManagedFilter<T, F> domInstanceIdFilter = DomInstanceExposers.Id.Equal(domInstanceId);
    DomInstance domInstance = domHelper.DomInstances.Read(domInstanceIdFilter).FirstOrDefault();

  3. Go through all linked Sections
  4. Use the Skyline.DataMiner.Net.Sections.Section.GetFieldValueById(FieldDescriptorID) method to find the FieldValue (Method GetFieldValueById | DataMiner Docs)

Hopefully this will help you out. Note that there's a change a more efficient way to do this does exist. In case you know a more performant way, please correct my answer.

Kind regards

Michiel Clepkens [SLC] [DevOps Advocate] Answered question 14th October 2022
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

DOM Definition relations returned in Definition query 0 Answers | 0 Votes
Alarm Dashboard PDF/CSV Export 1 Answer | 0 Votes
Is the Microsoft SharePoint Connector Still Usable 0 Answers | 0 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 (108) Correlation (68) Cube (150) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (55) 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) services (51) 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