Skip to main content
Employee - Guide
Nov 27, 2022 2:52 PM UTC
Solved

Change value of a "input value" parameter type

Hi !

I'm looking for a way to change a value of an input value parameter type using a business rule.

The use case is quite simple : the user will input a value in order to calculate a data. However, using a button I would like to "reset" the input value with another value.

I can easily change the value of a "litteral parameter" with a business rule, but I dont know how to change the value of a "input value" parameter type (needless to say, a litteral parameter will not allow my user to input a value !)  ... so what would be the best way to achieve this ?

 

Regards,

CosimoAnswer
Contributor
Nov 28, 2022 4:11 PM UTC

Sergey,

All of your session dashboard parameters (on selection change)  are stored/accessible in the dictionary args.SelectionChangedTaskInfo.CustomSubstVarsWithUserSelectedValues.

Say you have a Textbox dashboard component that's used for input is assigned the parameter Param1, you can read or modify the value behind for Param1 as followed:

Dim dashDic as dictionary = args.SelectionChangedTaskInfo.CustomSubstVarsWithUserSelectedValues

'check to see if Param1 is in dashDic dictionary:

If dashDic.ContainsKey("Param1") then

    'read the value:

   Dim x as string = dashDic("Param1")

   'write a value to Param1:

   dashDic("Param1") = "xxxxxxxx"

End if

 

 

 

 

4 replies

Employee - Sage
Nov 28, 2022 9:34 AM UTC

I believe, from a rules perspective, there shouldn't be any difference between changing values in a Literal or Input Parameter...? If you're trying and it doesn't work, can you post the relevant code? Also, after changing the value, make sure you refresh any Dashboard that might be affected by it, or you won't see any difference.

CosimoAnswer
Contributor
Nov 28, 2022 4:11 PM UTC

Sergey,

All of your session dashboard parameters (on selection change)  are stored/accessible in the dictionary args.SelectionChangedTaskInfo.CustomSubstVarsWithUserSelectedValues.

Say you have a Textbox dashboard component that's used for input is assigned the parameter Param1, you can read or modify the value behind for Param1 as followed:

Dim dashDic as dictionary = args.SelectionChangedTaskInfo.CustomSubstVarsWithUserSelectedValues

'check to see if Param1 is in dashDic dictionary:

If dashDic.ContainsKey("Param1") then

    'read the value:

   Dim x as string = dashDic("Param1")

   'write a value to Param1:

   dashDic("Param1") = "xxxxxxxx"

End if

 

 

 

 

Contributor
Nov 28, 2022 4:14 PM UTC

Forgot to add that once you update the dictionary, you will need to return it back to the dashboard:

Dim scstr As New XFSelectionChangedTaskResult()

scstr.ChangeCustomSubstVarsInDashboard = True

scstr.ModifiedCustomSubstVars = dashDic

Return scstr