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
    • Empower Replay: Limited Edition
    • 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
    • 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
    • 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
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

GetTablePrimaryKeys() doesn’t seem to be retrieving new values when running a 2nd time in automation

Solved365 views19th February 2025Automation
1
Ross Elliott [DevOps Advocate]819 19th February 2025 0 Comments

Hi, I have the following method that I call twice, once before an upgrade and once after. I compare csv files generated by getting a table and storing the values into a file before/after. My ‘after’ csv never gets the full list even though I can see the data in the Element in DataMinerCube. If I run a get primary keys manually it of course gets the updated values. Is the Element object somehow cached? Is there a way I can force a fresh get primary keys on the 2nd run of the method to debug whether this is the issue?

Thanks

public static bool GetLicenses(IEngine engine, IActionableElement element, string fileName, string fileLocation, string logFile)
{
StringBuilder csvContent = new StringBuilder();
string file = fileLocation + “\\Licenses\\” + fileName;

if (!Directory.Exists(fileLocation + “\\Licenses\\”))
{
Directory.CreateDirectory(fileLocation + “\\Licenses\\”);
}

File.AppendAllText(logFile, DateTime.Now.ToString(“dd/MM/yyyy h:mm tt”) + ” – SUCCESS|Licenses directory created or existed:” + fileLocation + Environment.NewLine);

string[] rows = element.GetTablePrimaryKeys(500);
var sortedKeys = rows.Select(int.Parse).OrderBy(n => n);
foreach (int sortedKey in sortedKeys)
{
string key = sortedKey.ToString();
var featureValue = element.GetParameterByPrimaryKey(503, key);

if (featureValue.ToString() == “2”)
{
csvContent.AppendLine($”{element.GetParameterByPrimaryKey(502, key)}, Enabled”);
// engine.GenerateInformation(“Feature “+ element.GetParameterByPrimaryKey(502, key)+ ” is enabled”);
}

if (featureValue.ToString() == “1”)
{
csvContent.AppendLine($”{element.GetParameterByPrimaryKey(502, key)}, Disabled”);
// engine.GenerateInformation(“Feature “+ element.GetParameterByPrimaryKey(502, key)+ ” is enabled”);
}
}

Ross Elliott [DevOps Advocate] Selected answer as best 19th February 2025

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
4
João Severino [SLC] [DevOps Catalyst]13.09K Posted 19th February 2025 2 Comments

Hi Ross,

Could you confirm if you are using the NoKeyCaching flag?

Your use case appears very similar to this other question.
Make Element update in Automation Script – DataMiner Dojo

Ross Elliott [DevOps Advocate] Selected answer as best 19th February 2025
Ross Elliott [DevOps Advocate] commented 19th February 2025

I'm not using that flag at the moment, will take a look at this answer. Thanks!

Ross Elliott [DevOps Advocate] commented 19th February 2025

engine.SetFlag(RunTimeFlags.NoKeyCaching); works perfectly!! Thanks!!

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