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

Validate Data in Table Column in a Element

Solved396 views29th November 2024Automation automion script
0
João Azevedo237 19th November 2024 8 Comments

Hello everyone! I need help accessing data from the rows of a table in my element, in order to validate whether a record already exists. I tried using methos like GetParameter, but without success(keep getting "-1" as return, even if the information in the table is correct).

With the code bellow i can access the "primaryKey" column because it is a DisplayKey in my table and validate it, but JobID is not a key item, but need to be unique. How can i do it?

Element element = engine.FindElement("MP API Interface");
var requestBody = JsonConvert.DeserializeObject<JobData>(requestData.RawBody);
string primaryKey = $"{requestBody.WorkOrderId}/{requestBody.ServiceDefinitionName}/{requestBody.ServiceDefinitionGroup}";
string jobID = "";

do{
jobID = Guid.NewGuid().ToString();
string [] primaryKeys = element.GetTableDisplayKeys(7000);
if(primaryKeys.Contains(primaryKey)){
{engine.GenerateInformation("Registry found");}
else
{engine.GenerateInformation("New Registry");}

} while()

P.S.:The column "Instance ID" which is generated by DataMiner is the PK in my table.

P.S. 2: The while condition will be defined after i have a way to validate the info.

P.S. 3: As asked, i'm leaving the Table image. We will change the table Primary Key to the column "Primary Key"(ID 7020) and the Display Key to the column "Job ID"(ID 7001).

Thank you all in advance for your attention!

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 29th November 2024
Jorge Dias [SLC] [DevOps Enabler] commented 20th November 2024

Hi João, to help understand the logic that needs to be implemented could you add a screenshot of your table with the primaryKey/displayKey, the ID(s) of those columns and the value that is composed in your primary key variable from your code?

João Azevedo commented 21st November 2024

Hello Jorge, sorry the delay and thank you for your response. I updated the question with the asked information.

Jorge Dias [SLC] [DevOps Enabler] commented 21st November 2024

Hi João, column Primary Key seems to have repeated value which should not be the case, each value should be unique maybe that is the reason.
Could you also debug the content of primaryKeys variable? By doing a foreach and generating an information event with the content for instance to see what you get?

João Azevedo commented 21st November 2024

It has duplicated values because we can't access the table column values to validate it, this is the point of this question. The variable primaryKey in my code is a string built with some info that come from the request body. As i reported initaly, i can access the data in a column with a tag "Display Key", but i can't access the column "Primary Key" tag.

Jorge Dias [SLC] [DevOps Enabler] commented 21st November 2024

Yes, I needed to know the content of the primaryKeys array that is fetched from GetTableDisplayKeys. Normally the code should work, needed that to know if the issue comes from that method not returning what we are expecting

Show 3 more comments

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
0
Marieke Goethals [SLC] [DevOps Catalyst]5.54K Posted 29th November 2024 0 Comments

It looks like this question has already been answered in the comments. To make it clear that this question no longer requires an answer, I have added this pro forma answer so that we can mark it as resolved.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 29th November 2024
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