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
    • 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
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about 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)
      • Book your Agile Fundamentals training
      • Book you Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

Read and Insert DOM instance

Solved120 views4 days ago
1
Juan Falcon439 21st November 2025 0 Comments

Hello dojo, Im straing with DOM

Im tring to use script automate to insert and read all the field of each one to import from CSV and genere API output.

how can i insert a row into tha instance?

How can i read each row, using _domHelper.DomInstances.ReadAll(); i only have the ID and not the full row data.

Thanks

Juan Falcon Selected answer as best 4 days ago

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
3
Tom Waterbley [SLC] [DevOps Catalyst]9.52K Posted 5 days ago 4 Comments

Hi Juan,

The instances that you retrieve using ReadAll() also contain the values. But as explained here, the values are grouped into sections. So to retrieve the values, you need to go through the instance.Sections property. Or one of the extension method, such as instance.GetFieldValue().

Examples of this, and also on how to store data in a DOM instance, can be found here: https://docs.dataminer.services/dataminer/Functions/DOM/DOM_examples/DOM_Altering_values_of_a_DomInstance.html.

Kind regards,

Tom

Juan Falcon Posted new comment 4 days ago
Thomas Ghysbrecht [SLC] [DevOps Enabler] commented 5 days ago

To extend this reply, some additional links that may be helpful:

– Additional info on the read API: https://docs.dataminer.services/dataminer/Functions/DOM/DomHelper_class.html#reading-dom-data

– Example of how to read a bunch of DOM instances when you have a list of IDs. https://docs.dataminer.services/dataminer/Functions/DOM/DomHelper_class.html#reading-dom-data
(Section 'Read all relevant DOM data in one call')

Juan Falcon commented 5 days ago

hello finali get read an insert data with this code.

var domDefinitionId = Guid.Parse("eb7c180f-bb6b-4816-a450-dbced2eed144"); // Vehicles definition
var definitionFilter = DomInstanceExposers.DomDefinitionId.Equal(domDefinitionId);
var all = domHelper.DomInstances.Read(definitionFilter);
foreach (var doc in all)
{
var locationVar = doc.Name;
var locationVar2 = doc.Sections;
var locationVar3 = doc.StatusId;
var locationVar4 = doc.WasStitched;
foreach ( var seccionVar in locationVar2)
{
engine.GenerateInformation($" {seccionVar.GetValue<string>(PlacaFieldDescriptorId)} – {seccionVar.GetValue<int>(LocationFieldDescriptorId)} – {seccionVar.GetValue<int>(CapabilitesFieldDescriptorId)} – {seccionVar.GetValue<Int64>(NumberOfCamerasFieldDescriptorId)} ");
}
}

Insert

var domInstance = new DomInstance() { DomDefinitionId = domDefinitionId };
domInstance.AddOrUpdateFieldValue<string>(sectionDefinitionId, PlacaFieldDescriptorId, "Placa2");
domInstance.AddOrUpdateFieldValue<int>(sectionDefinitionId, LocationFieldDescriptorId, 1);
domInstance.AddOrUpdateFieldValue<Int64>(sectionDefinitionId, NumberOfCamerasFieldDescriptorId, 7);
// Campo faltante 1: Size (int)
// Ejemplo: Medium = 1
domInstance.AddOrUpdateFieldValue<int>(sectionDefinitionId, SizeFieldDescriptorId, 1);

var doubleList = new List<int>() {1, 2 };
domInstance.AddOrUpdateListFieldValue<int>(sectionDefinitionId, CapabilitesFieldDescriptorId, doubleList);

var createdDomInstance = domHelper.DomInstances.Create(domInstance);

In the example i sow the rading by page:
var pagingHelper = helper.DomInstances.PreparePaging(filter); // Prepare with default page size of 500
while (pagingHelper.MoveToNextPage())
{
var currentPage = pagingHelper.GetCurrentPage();
// Handle current page of data…
}

How can i implement a code to read only a especific page without MoveToNextPage, i will implement a custom api with a query parameter to get a page number so i dont need use the MoveToNextPage in the code.

Thanks

Thomas Ghysbrecht [SLC] [DevOps Enabler] commented 5 days ago

Regarding your paging question. Getting a specific page is not supported, it is only possible to scroll through pages using a cookie (that is embedded in the PagingHelper). Although, it would be possible to have such a behavior by getting and ignoring the previous pages every time, we would not recommend such an implementation as this is very inefficient.

Juan Falcon commented 4 days ago

i understand, thanks

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
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