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

Get Parameter name from ID within Automation Script

Solved642 views7th August 2024Automation GetProtocolInfoResponseMessage parameter ProtocolInfo
1
Nick Chirumbolo [DevOps Advocate]677 10th June 2024 0 Comments

I'm trying to retrieve a Parameter's name using its ID and element data (From an alarmInfo string).

I don't see this in the Element class, so I assume it would be in the element.protocol object. Unfortunately the link to documentation about this is broken (See below), so I'm not sure how to (or if) I can accomplish this. I currently can access the "GetProtocolInfoResponseMessage" object of the desired Protocol, but not sure how to proceed.

For reference here are all the references I can find to GetProtocolInfoResponseMessage, which all appear to be broken links:

Element.Protocol: Property Protocol | DataMiner Docs

Dummy.Protocol: Property Protocol | DataMiner Docs

IActionableElement.Protocol: Property Protocol | DataMiner Docs

IConnection.GetProtocol(): Method GetProtocol | DataMiner Docs

Thanks!

Nick Chirumbolo [DevOps Advocate] Selected answer as best 7th August 2024

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
1
Tom Waterbley [SLC] [DevOps Catalyst]8.86K Posted 10th June 2024 5 Comments

Hi Nick,

If you already have access to the Element object, you can retrieve the parameter name as follows:

Element element;
int parameterId = 123;

var protocol = element.Protocol;
var parameter = protocol.Parameters.FirstOrDefault(p => p.ID == parameterId);
var name = parameter.Name;

Nick Chirumbolo [DevOps Advocate] Selected answer as best 7th August 2024
Nick Chirumbolo [DevOps Advocate] commented 10th June 2024

Thank you, exactly what I was looking for!

Nick Chirumbolo [DevOps Advocate] commented 10th June 2024

Actually, now that I’m testing the script it’s throwing this error:
error CS1061: ‘ParameterInfo[]’ does not contain a definition for ‘FirstOrDefault’ and no accessible extension method ‘FirstOrDefault’ accepting a first argument of type ‘ParameterInfo[]’ could be found (are you missing a using directive or an assembly reference?)
.
.
Here is my implementation:
string alarmInfo = engine.GetScriptParam(65006).Value;
string[] parts = alarmInfo.Split(‘|’);
…
dmaID = Tools.ToInt32(parts[1]);
elementID = Tools.ToInt32(parts[2]);
int parameterID = Tools.ToInt32(parts[3]);
…
Element elem = engine.FindElement(dmaID, elementID);
var protocol = elem.Protocol;
var param = protocol.Parameters.FirstOrDefault(p => p.ID == parameterID);
string parameterName = param.Name;
.
.
Any ideas what’s causing this?

Nick Chirumbolo [DevOps Advocate] commented 10th June 2024

Not sure why that method isn’t working, but this does work:
…
Element elem = engine.FindElement(DmaID, ElementID);
string parameterName = “”;
foreach (var param in elem.Protocol.Parameters)
{
if (param.ID == ParameterID)
{
parameterName = param.Name;
break;
}
}

Tom Waterbley [SLC] [DevOps Catalyst] commented 10th June 2024

The reason why you get that error is because a using statement for “System.Linq” is missing at the top of the file. After adding that you should be able to use the FirstOrDefault method. But good to see that you found an alternative that also works fine.

Tom Waterbley [SLC] [DevOps Catalyst] commented 26th June 2024

Hi Nick, in the meantime we have also fixed the references to GetProtocolInfoResponseMessage in the docs. Thanks for bringing that to our attention.

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

Alarm Dashboard PDF/CSV Export 1 Answer | 0 Votes
Is the Microsoft SharePoint Connector Still Usable 0 Answers | 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 (139) driver (65) DVE (55) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (151) 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