- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 03:04 AM - edited 02-12-2024 03:07 AM
Hello community,
I need a help regarding:
I have created 3 sections for 3 different tables, In addition to that we have to show the specific section i.e section 1 (As shown in below pic) for specific assignment group member. is it possible to do that in workspace?
for e.g:
section 1 should be visible for only ABC user (ABC is already a member of PQR group), and the table role is also already given to PQR group(so obviously if i impersonate ABC user the table will be accessible for him).
If i try to impersonate member ABC so for this user section 2 and 3 shouldn't be visible. Only the member should be able to see section 1. Because he is member of PQR group.
Right now the issue is that, all of the 3 sections visible for every user.
Let me know if you have answer for this, thank you 🙂
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 06:43 AM
Hi @Sanket Kutwal ,
- Select the component or container that needs to have a dynamic visibility
- In the config panel, click the visibility icon
- Click on the script icon
- Set the visibility condition
/** * @param {params} params * @param {api} params.api * @param {TransformApiHelpers} params.helpers */ function evaluateProperty({api, helpers}) { let user_roles = api.context.session.user.roles; let visibility_condition = user_roles.includes("THE USER'S ROLE THAT SHOULD NOT SEE THE ELEMENT"); return visibility_condition; }
- https://www.servicenow.com/community/developer-forum/hide-a-component-on-workspace-based-on-role/m-p...
- https://www.servicenow.com/community/next-experience-articles/how-to-hide-a-container-component-in-u...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2024 11:17 PM
Just wanted to post an update on this, we have not obtained the results by doing above steps because it was causing an issue, We have created new separate landing page and we have created a separate audience for that and it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 06:43 AM
Hi @Sanket Kutwal ,
- Select the component or container that needs to have a dynamic visibility
- In the config panel, click the visibility icon
- Click on the script icon
- Set the visibility condition
/** * @param {params} params * @param {api} params.api * @param {TransformApiHelpers} params.helpers */ function evaluateProperty({api, helpers}) { let user_roles = api.context.session.user.roles; let visibility_condition = user_roles.includes("THE USER'S ROLE THAT SHOULD NOT SEE THE ELEMENT"); return visibility_condition; }
- https://www.servicenow.com/community/developer-forum/hide-a-component-on-workspace-based-on-role/m-p...
- https://www.servicenow.com/community/next-experience-articles/how-to-hide-a-container-component-in-u...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 04:47 AM
Hi @Community Alums Thank you for the response solution working perfect.
Currently I've created 3 sections in the single landing page and I'm showing/hiding those containers based on the user roles, what if i create 3 landing pages, and i want to show the correct landing page for correct member and hide from rest of the users. is this achievable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 05:32 AM
Hi @Sanket Kutwal ,
Glad the solution worked for you!!
Your original question has been answered , kindly close the thread by marking the answer correct and helpful and create another question please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2024 11:17 PM
Just wanted to post an update on this, we have not obtained the results by doing above steps because it was causing an issue, We have created new separate landing page and we have created a separate audience for that and it worked.