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

GetParameterByPrimaryKey recusive table fail

Solved748 views9th February 2023Automation C++
3
joel Joly489 7th February 2023 0 Comments

Hello DOJO

I am trying to get all parameters of a column from a table with c# automation
6400 is the index of the table
6404 is the index of the column whose data interests me

Element[] elems = engine.FindElementsByProtocol("myprotocol", "Production");
for (int i = 0; i < elems.Length; i++)
if (elems[i].IsActive)
{
var cardtable = elems[i].GetTablePrimaryKeys(6400);
for (int j = 1; j <= cardtable.Length; j++)
{
string index = j.ToString();
var VALELMT = index + " " + elems[i].GetParameterByPrimaryKey(6404, index );
}
}

I added index in the begining of line to see if the loop is OK

It works fine, except the fact that the parameters are identical for all lines :
1 ZQYR018_04
2 ZQYR018_04
3 ZQYR018_04
4 ZQYR018_04
5 ZQYR018_04


What do I miss ?

joel Joly Selected answer as best 9th February 2023

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
5
Laurens Moutton [SLC] [DevOps Enabler]8.73K Posted 7th February 2023 1 Comment

Hi,

  • The value present in cardtable is not being used when executing GetParameterByPrimaryKey. This is now calling with fixed keys from 'index': "1", "2", "3",... (the value of 'index' = variable 'j'). Is this the intention? I would assume that somewhere cardtable[j] would be used to execute GetParameterByPrimaryKey. Also note that the for loop starts with int j = 1, that should probably be 0 and run until j<cardtable.Length or an IndexOutOfRange exception would be thrown when looping until j<=cardtable.Length and then trying to access cardtable[j].
  • What is also missing from the screenshot is the value of the displaykey. In the background automation scripts are relying on displaykeys, not primary keys. If the displaykey is duplicate then it will not map back to a correct primary key
joel Joly Selected answer as best 9th February 2023
joel Joly commented 9th February 2023

Thanks for you help Laurens

I made a mistake by supposing that the index was a row position in database like 0 or 1 for the first element and so on

I succeeded by using a for each loop :
var cardtable = elems[i].GetTablePrimaryKeys(6400);
foreach (var sub in cardtable)
{
VALELMT2 = elems[i].GetParameterByPrimaryKey(6402,sub) ;

etc.

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

Recent questions

Web Applications exception in Cube due to invalid certificate 0 Answers | 0 Votes
Redundancy Groups and Alarming – Duplicate Alarms 0 Answers | 0 Votes
Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 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 (109) Correlation (69) Correlation rule (52) Cube (151) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) 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) 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