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.
Hi Gerwin
Retrieving FieldValues from a DOM instance can be done using the following steps:
- Create an object of the DomHelper class (DomHelper class | DataMiner Docs)
- 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(); - Go through all linked Sections
- 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