Customize CSM/FSM configurable workspace dashboard landing page

Sanket Kutwal
Tera Expert

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.

 

SanketKutwal_1-1707735231056.png

 

Let me know if you have answer for this, thank you 🙂

 

 

2 ACCEPTED SOLUTIONS

Community Alums
Not applicable

Hi @Sanket Kutwal ,

  1. Select the component or container that needs to have a dynamic visibility

  2. In the config panel, click the visibility icon
    SandeepDutta_0-1707748928565.png

     



  3. Click on the script icon
    SandeepDutta_1-1707748928579.png

     



  4. 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;
    }​


     SandeepDutta_2-1707748928594.png

     

    Please follow these links :
  5. https://www.servicenow.com/community/developer-forum/hide-a-component-on-workspace-based-on-role/m-p...
  6. https://www.servicenow.com/community/next-experience-articles/how-to-hide-a-container-component-in-u...

View solution in original post

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.

View solution in original post

4 REPLIES 4

Community Alums
Not applicable

Hi @Sanket Kutwal ,

  1. Select the component or container that needs to have a dynamic visibility

  2. In the config panel, click the visibility icon
    SandeepDutta_0-1707748928565.png

     



  3. Click on the script icon
    SandeepDutta_1-1707748928579.png

     



  4. 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;
    }​


     SandeepDutta_2-1707748928594.png

     

    Please follow these links :
  5. https://www.servicenow.com/community/developer-forum/hide-a-component-on-workspace-based-on-role/m-p...
  6. https://www.servicenow.com/community/next-experience-articles/how-to-hide-a-container-component-in-u...

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? 

Community Alums
Not applicable

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.

 

 

 

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.