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

Change custom property of views in bulk

Solved1.45K views18th July 2023
0
Cristel Van Landeghem [DevOps Advocate]468 17th August 2021 0 Comments

Is there a way to change a custom property of several views in bulk ?

Our customer Panasonic Airlines needs to change a customer property of > 1000 views, so …

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 18th July 2023

3 Answers

  • Active
  • Voted
  • Newest
  • Oldest
2
Debeuf Klaas [SLC] [DevOps Advocate]1.67K Posted 17th August 2021 0 Comments

Hi,

Maybe automation can help you achieve this.
This automation script below should do the trick(please test it first on a limited setup).

Note that this is an internal call and we do not recommend using this, as it is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice. We recommend to instead always use the correct UI or automation options provided in DataMiner Automation or through our web API.

using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net.Messages.Advanced;
using Skyline.DataMiner.Net;
using Skyline.DataMiner.Net.Messages;
using System;
using System.Collections.Generic;

public class Script
{
public void Run(Engine engine)
{
ViewInfoEventMessage[] allViews = GetViews();
if(allViews == null)
{
engine.ExitFail(“No views were found”);
}

foreach(ViewInfoEventMessage view in allViews){
// do the filtering of views you want to update
if(view.Name.Equals(“Temp”))
{
UpdateViewProperty(view,”PROPERTY YOU WANT TO UPDATE”,”NEW PROPERTYVALUE”,engine);
}
}
}

public void UpdateViewProperty(ViewInfoEventMessage view, string propertyName, string propertyValue, Engine engine)
{
SetDataMinerInfoMessage request = new SetDataMinerInfoMessage();
request.bInfo1 = Int32.MaxValue;
request.bInfo2 = Int32.MaxValue;
request.DataMinerID = -1;
request.ElementID = -1;
request.HostingDataMinerID = -1;
request.IInfo1 = Int32.MaxValue;
request.IInfo2 = Int32.MaxValue;

SA sa = new SA();
sa.Sa = new String[] { propertyName, “read-write”, propertyValue };
PSA psa = new PSA();
psa.Psa = new SA[] { sa };
request.Psa2 = psa;

request.StrInfo1 = $”view:{view.ID}”;
request.What = 62;
SetDataMinerInfoResponseMessage response = engine.SendSLNetSingleResponseMessage(request) as SetDataMinerInfoResponseMessage;
if (response.iRet != 0)
{
engine.GenerateInformation($”Update of property {propertyName} on View {view.Name} was not OK”);
}
}

public ViewInfoEventMessage[] GetViews()
{
var getViewsList = new GetInfoMessage
{
DataMinerID = -1,
Type = InfoType.ViewInfo
};

DMSMessage[] dmsma = Engine.SLNet.SendMessage(getViewsList);

if (dmsma == null)
{
return null;
}

return Array.ConvertAll(dmsma, input => (ViewInfoEventMessage)input);
}
}

Regards,

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 18th July 2023
1
Miguel Obregon [SLC] [DevOps Catalyst]19.13K Posted 17th August 2021 0 Comments

Hi Cristel,

I am afraid that currently this is not possible. At the moment, you can update one view property at the time.

In 10.1.9.0, there will be a new feature that will allow you to create views in bulk. However, this feature will not cover the update of view properties in bulk. In case you consider this feature required, please could you add this request in Feature Suggestion?

Miguel Obregon [SLC] [DevOps Catalyst] Answered question 17th August 2021
0
André Kaiser [DevOps Advocate]532 Posted 9th June 2023 1 Comment

I used the script above to succesfully modify a property value of a view. As a next step I would like to update the value whenever the severity of the view changes. The value should be the Display Value of the severity. To trigger the script I would set up a correlation rule, that triggers

My assumption is that I would have to replace the “NEW PROPERTYVALUE” by a variable and dynamically update this variable with the severity of the view.

{
UpdateViewProperty(view,”PROPERTY YOU WANT TO UPDATE”,”NEW PROPERTYVALUE“,engine);
}

André Kaiser [DevOps Advocate] Posted new comment 20th June 2023
André Kaiser [DevOps Advocate] commented 20th June 2023

Is there someone, who could support me with getting the Alarm state of a view and assign it to a variable in my script? Maybe there is an easy method for this available?

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