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
      • General Inquiries
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

IDmsColumn.Lookup() doesn’t return any rows

Solved1.24K views21st October 2022C++ protocol Visual Studio
1
Robin Becker [DevOps Advocate]1.40K 21st October 2022 0 Comments

The following returns an empty array:

var sdnoRow = sdnoColumn.Lookup(channel.Label);

However, the following returns true:

sdnoColumn.GetValue(“31793.0.31794”).Equals(channel.Label)

Have I misunderstood what Lookup() is supposed to do?

EDIT: More context added

var dms = protocol.GetDms();
var sdnoV2 = dms.GetElement(new DmsElementId(127701, 250));
var sdnoDestinationsTable = sdnoV2.GetTable(1300);
IDmsColumn<string> sdnoColumn = sdnoDestinationsTable.GetColumn<string>(1302);

foreach (var channel in channels)
{
var sdnoRow = sdnoColumn.Lookup(channel.Label);
…
}

I ended up using IDmsTable.QueryData() instead.

Robin Becker [DevOps Advocate] Selected answer as best 21st October 2022

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
4
Mieke Dryepondt [SLC] [DevOps Advocate]3.58K Posted 21st October 2022 0 Comments

Hi Robin,

I just verified: the Lookup method uses the Notify GetKeysForIndex.
This notify requires the lookup-column to be indexed (e.g. via ;indexColumn option) so the search can happen.
https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Scripting.SLProtocol.GetKeysForIndex.html

I would personally avoid using this method as you would need to update the other driver(s).
Instead you could use QueryData(filter)
https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Library.Common.IDmsTable.QueryData.html

For example, this is used in one of our Tests:

IDms dms = new Dms(communication);
IDmsElement element = dms.GetElement(Settings.TestElementName);
IDmsTable table = element.GetTable(exampleTableId);

List<ColumnFilter> filter = new List<ColumnFilter>();
filter.Add(new ColumnFilter { Pid = exampleTableId + 2, Value = “DK Row 1”, ComparisonOperator = ComparisonOperator.Equal });

foreach (object[] row in table.QueryData(filter))
{
if (row == null || row.Length < 6)
{
hasUnknown = true;
break;
}

string pk = Convert.ToString(row[0]);
string dk = Convert.ToString(row[1]);
string textVal = Convert.ToString(row[2]);
int intVal = Convert.ToInt32(row[3]);
double doubleVal = Convert.ToDouble(row[4]);
DateTime dtVal = DateTime.FromOADate(Convert.ToDouble(row[5]));
}

Robin Becker [DevOps Advocate] Selected answer as best 21st October 2022
1
Mieke Dryepondt [SLC] [DevOps Advocate]3.58K Posted 21st October 2022 1 Comment

Hi Robin,

The purpose of the Lookup is to search 1 or multiple values in a specific column and return the primary keys of all the rows where those values could be found.

Would it be possible to share a bit more of the code? So we can verify everything is correctly initialized?

Robin Becker [DevOps Advocate] Posted new comment 21st October 2022
Robin Becker [DevOps Advocate] commented 21st October 2022

Sure thing! See EDIT for more context.

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