Workspace Query
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 07:27 AM - edited 03-09-2023 02:29 AM
But i need the "Company" donut should be displayed only when the "Your Company " button is selected.
But now when i select "Your work " button also "company " donut is displaying.
I want the "Company" donut should be shown only when the "Your company" is selected .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 08:15 AM
1. Create a Boolean type state parameter. i.e. hideCompany. Set the value to true by default.
2. On the dropdown component events, choose event "dropdown selected item set" and choose "Update client state parameter" event handler. Now, select "hideCompany" parameter and bind the value like below.
Note that my_company here is the "id" from of your "list items" property of dropdown component.
That's it!
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 08:28 PM
0@JagjeetSingh As per your suggestions i have added the state parameter and event Handler
BUt where do i need to add this line
If((@payload.Value=="company"),fasle,true)
where to type this script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 11:16 PM
When you click on "Update client state parameter" event handler, it asks you to select the parameter and then set a value for it.
You need to select the client state parameter you created and then in value set IF((@payload.value == "company"), false, true). Click on the the data binding icon while setting it.
ServiceNow Community Rising Star 2022/2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 08:31 AM
This article should give you a good idea of how show/hide works on components and how you can pass parameters to control that: https://www.servicenow.com/community/developer-articles/ui-builder-controlling-the-visibility-of-com...