I love it when I find something new in Unified Service Desk! I recently spotted an action I’d not used before whilst experimenting with USD v4.1. SetReplacementParameter. But what does this action do and why would you want to use it?
Often in my USD configuration I find the need to store variables as replacement parameters. Commonly the values are specific to my current active session, in this situation we use the “CopyToContext” action. I wrote about CopyToContext back in 2016! You can read that post here.
CopyToContext is great but what if you want to store a value that is global to all sessions? This is when we can use the SetReplacementParameter action.
Your first step might be to create the required UII action.
Note:
I am using USD v4.1 public preview version. I haven’t done any tests to see if this action works with earlier versions!
Create UII Action
Before you can experiment with SetReplacementParameter you may need to add it as a UII action on your Global Manager hosted control. To do this open your Global Manager and use the “Related” option to navigate to “UII Actions”.
Within UII Actions, if you don’t have an action called SetReplacementParameter. Simply use the “Add New UII Action” option and create it.
How Does SetReplacementParameter Work?
If you attempt to create an action call using the SetReplacementParameter UII action you’ll see the following help. It tells you pretty much everything you need to know!
Parameter | Comments |
appname | This can be any existing or new application name. |
Param | Simply enter the name of your parameter |
Value | Enter the value you want to assign to your parameter. |
global | I might have been doing something wrong! but I found all the replacement parameters I created were global, regardless of how I set this parameter.
So I didn’t actually bother setting this field! That didn’t worry me as I can use CopyToContext if I don’t want the parameter to be global! |
Below you can see that in the USD debugger I have added a global replacement parameter to an existing global application. (Called Announcements.)
Tip: Don’t forget to refresh your Data Parameters after running an action like this!
In this example, I can now use the parameter [[Announcements.MYTESTPARAM]g] to return my newly created global variable.
In this next example I decided to enter an appname that didn’t already exist. Here you can see that it created a new app key field value. [[$Global_Values.MYTESTPARAM]g]
I can imagine this to be really useful if I want to store a list of dynamic global value.
Hopefully you can see that this action could be really useful to anyone configuring Unified Service Desk. Enjoy.