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
    • 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
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about 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)
      • Book your Agile Fundamentals training
      • Book you Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

Updating a table row

Solved74 views4 days agoConnector table table rows
2
Ryan Hepworth [DevOps Advocate]1.25K 4 days ago 0 Comments

Hi All

I am currently looking at a connector, that when updated is using protocol.AddRow, this is going to lead to a new entry added to the table everytime.

Is there a method that can be used to update a row based on primary key index if it already exists and if it doesn't, then add a new row?

Thanks

Ryan Hepworth [DevOps Advocate] Selected answer as best 4 days ago

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
João Severino [SLC] [DevOps Catalyst]14.14K Posted 4 days ago 1 Comment

Hi Ryan,

The most basic way for you to achieve what you are after is to use a combination of 3 calls

  • protocol.Exists | DataMiner Docs
  • protocol.AddRow | DataMiner Docs
  • protocol.SetRow | DataMiner Docs

And you would do something like:

if(protocol.Exists(...){

protocol.SetRow(...)

}else{

protocol.AddRow(...)

}

If you want to use the SLProtocolExt interface, you could use this other SetRow method | DataMiner Docs that would look something like this

protocol.MyTableName.SetRow(..., true)

Where the true boolean value indicates to DataMiner to create a row if it does not exist for that primary key.

Ryan Hepworth [DevOps Advocate] Selected answer as best 4 days ago
João Severino [SLC] [DevOps Catalyst] commented 4 days ago

As an addendum, if your are processing multiple rows at once you could also look into the FillArray method https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Scripting.SLProtocol.FillArray.html?q=fillarray#Skyline_DataMiner_Scripting_SLProtocol_FillArray_System_Int32_System_Collections_Generic_List_System_Object____Skyline_DataMiner_Scripting_NotifyProtocol_SaveOption_

The SaveOption argument will let you select if you want to completely override the entire content of the table (Full) or leave what you do not provide untouched (Partial)
https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Scripting.NotifyProtocol.SaveOption.html

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