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

QAction set parameter not working

250 views2nd May 2025QAction QActions SLProtocol
3
samita Acharya180 2nd May 2025 2 Comments

I have a toggle and a qaction which is triggered on 18019(write parameter). The qaction will setParameter to other column values in the table based on the toggle.

One of the column is a datetime and another is range bound number control. When the toggle is enabled I disable one of these columns. With the qaction I want to set it to NA which will then be set to N/A in dataminer as greyed out parameter. The setParameter is not setting the values or throwing any errors. Is this possible to set? what am i missing?

<Param id=”18009″>
<Name>Data transform</Name>
<Description>Data transform</Description>
<Type>read</Type>
<Interprete>
<RawType>numeric text</RawType>
<LengthType>next param</LengthType>
<Type>double</Type>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
</Display>
<Measurement>
<Type>discreet</Type>
<Discreets>
<Discreet>
<Display>Scheduled</Display>
<Value>0</Value>
</Discreet>
<Discreet>
<Display>Offset</Display>
<Value>1</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>
<Param id=”18019″ setter=”true”>
<Name>Data transform</Name>
<Description>Data transform</Description>
<Type>write</Type>
<Interprete>
<RawType>numeric text</RawType>
<LengthType>next param</LengthType>
<Type>double</Type>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
</Display>
<Measurement>
<Type>togglebutton</Type>
<Discreets>
<Discreet>
<Display>Scheduled</Display>
<Value>0</Value>
</Discreet>
<Discreet>
<Display>Offset</Display>
<Value>1</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>

Below is snippet of qaction- when I log toggleValue it always return 0, no matter what is pressed on toggle. And the setParameter does not set anything.

public static void Run(SLProtocol protocol)
{
var toggleValue = protocol.GetParameter(18019)?.ToString();

if (toggleValue == “1”)
{
protocol.SetParameter(18017, “NA”); // write parameter

} else
{
protocol.SetParameter(18018, “NA”); // write parameter

}

}

This is how I plan to handle “NA” once setParameter works.

<Exception id=”1″ value=”NA”>
<Display state=”disabled”>N/A</Display>
<Value>NA</Value>
</Exception>
</Exceptions>

samita Acharya Posted new comment 2nd May 2025
Miguel Obregon [SLC] [DevOps Catalyst] commented 2nd May 2025

Hi,
If you are setting a row from a table, are you using the option row=True in the QAction tag?
https://docs.dataminer.services/develop/schemadoc/Protocol/Protocol.QActions.QAction-row.html

samita Acharya commented 2nd May 2025

Hi Miguel, yes I have added that already. Any other tips let me know

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
2
Laurens Moutton [SLC] [DevOps Enabler]8.78K Posted 2nd May 2025 5 Comments

Hi,

The write parameter has setter=”true” defined. In such case it will set the value on the read parameter 18009, but if there is then a trigger on the write parameter it will not be possible anymore to get the value of the write parameter through the QAction.

To fix this:
-Remove the setter=”true” attribute from the write parameter
-Make sure that row=”true” is present on the QAction
-In the QAction execute string rowKey = protocol.RowKey(); to get the row key as this is needed to fill in the read parameter.
-Set the read parameter from the QAction by using protocol.SetParameterIndexByKey(18000, rowKey, 9, toggleValue) (note that “9” is the one based column position of the read parameter, so if idx=”8″ then 9 should be used here, and I’m assuming that 18000 is the parameter id of the table)

Regards,

samita Acharya Posted new comment 6th May 2025
samita Acharya commented 2nd May 2025

Hi Laurens, thank you for your response. I have tried those steps but no luck. Once i remove the setter=true, the UI will not store the new value in the read parameter so I have added that back in. would you advise to trigger on the read parameter instead?

José Silva [SLC] [DevOps Catalyst] commented 2nd May 2025

Hi Samita,

If you remove setter = true, it's expected that the read parameter won't reflect updated values. However, when triggering the QAction, you can retrieve the value from the write parameter and explicitly set it on the read parameter within the QAction logic.

samita Acharya commented 2nd May 2025

That makes sense, I added it like this after removing the setter but I am not seeing the value reflected on frontend for 18019.
public static void Run(SLProtocol protocol)
{
protocol.Log("QAction triggered by toggle (18019)", LogType.Information);

// Read the write param directly (this is what the toggle sets)
var toggleValue = protocol.GetParameter(18019)?.ToString();

string rowKey = protocol.RowKey();

protocol.Log($"Toggle value is {toggleValue}", LogType.Information);

if (toggleValue == "1")
{
protocol.SetParameterIndexByKey(18000, rowKey, 8, "NA");
protocol.SetParameterIndexByKey(18000, rowKey, 10, "0");
var confirm = protocol.GetParameter(18007);
protocol.Log("18017 after setting to NA: " + (confirm == null ? "null" : confirm.ToString()), LogType.Information);
}
else
{
protocol.SetParameterIndexByKey(18000,rowKey,9, "NA");
protocol.SetParameterIndexByKey(18000, rowKey, 10, "1");
var confirm = protocol.GetParameter(18008);
protocol.Log("18018 after setting to NA: " + (confirm == null ? "null" : confirm.ToString()), LogType.Information);
}
}

NA isn't being set either as my log returns below. Am i setting up SetParameterIndexByKey incorrectly?

18018 after setting to NA: 0

Laurens Moutton [SLC] [DevOps Enabler] commented 5th May 2025

-What are parameters 18007 and 18008: are these table column parameters?
-Is the read column parameter of the write parameter tried to be set with protocol.SetParameterIndexByKey(18000, rowKey, 10, "0") ? If that is the case, then is idx="9" with pid="18009" in the ColumnOption of the table parameter or what is idx for pid="18009"? If that set is for the read parameter is indeed happening there then why is the opposite value of the write parameter tried to be set: if toggleValue == "1" then the read parameter should also be set to "1", which I don't see happening here.

samita Acharya commented 6th May 2025

I have it working now thank you. It was the indexing that was incorrect

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