Dear Dojo,
I want to add a new param to my protocol with multiple default values. Is it possible to do this? If so, how? Can someone please help me?
Thank you
Hi Carlos,
I can't see the param in the query, what am I doing wrong? I put the param here.
Thank you
Hi Marco,
As Carlos said, its not possible to have multiple default values on a parameter (in case you are referring to using the DefaultValue element as described in DefaultValue element | DataMiner Docs)
However, you can hardcode all possible values in C# (via a QAction) and trigger that QAction during startup. Based on certain conditions (e.g., other parameters), you can set the desired value programmatically.
There are several ways to trigger a QAction (timer, button, etc) so this will depend on the use case
Kind regards,
Hi Marco,
I believe it is not possible to add multiple default values to a parameter, if you are referring to using the DefaultValue element as described in DefaultValue element | DataMiner Docs
However, if you meant creating a new dropdown parameter with fixed values, here is a quick example of how to create a "fixed drop-down" parameter:
<Param id="53">
<Name>fixedDropDownExample</Name>
<Description>Fixed Dropdown</Description>
<Type>write</Type>
<Interprete>
<RawType>other</RawType>
<LengthType>next param</LengthType>
<Type>string</Type>
</Interprete>
<Measurement>
<Type>discreet</Type>
<Discreets>
<Discreet>
<Display>Option 1</Display>
<Value>Option1</Value>
</Discreet>
<Discreet>
<Display>Option 2</Display>
<Value>Option2</Value>
</Discreet>
<Discreet>
<Display>Option 3</Display>
<Value>Option3</Value>
</Discreet>
</Discreets>
</Measurement>
</Param>
Example read/write dropdown param:
You actually need both parameters. The read parameter will store and display the selected value of the dropdown, while the write parameter will represent the actual dropdown displaying the available options. I attached a screenshot to the original reply showing both, read and write parameter.
To answer your second question: yes, the protocol version will need to be updated to the one that includes the new dropdown parameter.
Hi Carlos. This is exactly what I’m looking for. I want to use this param’s data to display them in a drop down menu in a low-code app. The param will be selected from a CGI query. I have two more questions for you. Are you sure that the type of the param is write and not read? The second question is: to show the param in a CGI query, I need to bump the protocol version, right?
Thank you