Home › Unified Service Desk › USD Toolbar Button Visibility and Replacement Parameter Logic
Unified Service Desk · Jan 30, 2019 · 2 MIN READ

USD Toolbar Button Visibility and Replacement Parameter Logic

In Unified Service Desk, we can use Toolbar buttons to perform actions in the application. For example here we have toolbar buttons in the main application:

Now let’s say we want to hide and show these buttons based on certain values. For example, if the user is based in the US, and the Maps application is loaded, we may want to show a button that allows us to open a navigation app specific to this environment. We would not want to show this button to users that are in a different region who may have their own software.

To do this, let’s first create a new toolbar button in the main toolbar:

Go to the visible condition:

We will need replacement parameters to help with the code here. Open the USD Debugger and copy the replacement parameters for the Bing Maps URL and the Country Address:

Let’s form our expression as:

"[[Bing Map New.url]g]" != "" && "[[systemuser.address1_country]g]" == "US"

Now let’s open USD. We see the new button for this user:

And if a user that is not in the US opens the USD, we don’t see the button:

In some cases, you will want to use the + replacement key to replace a null replacement parameter with a blank string. If you don’t do this, the condition will fail.

Note you can use this logic in other areas such as if the button is enabled or not.

 

Carl de Souza
Keep learning. Keep building.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.

Subscribe on YouTube →
Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert

One Response to USD Toolbar Button Visibility and Replacement Parameter Logic

  1. Hi carl,
    This article is very helpful thanks
    Can you help me with how to visible condition for different pagetype.

    My requirement is I want to show toolbar button fir pagetype=entityrecord not for entitylist

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.