Hide "Preview" button on portal if caller !Assignedto

F_bio Santos
Kilo Sage

Hi everyone I was wandering, if there is any way to only show the "preview" button on the portal if the referenced record is assigned to the user that is currently logged in, for example we a variable called "Hardware" that will display the records on the cmdb that are assigned to the referenced user of a variable "caller" but the client only wants the user to be able to "preview" the "hardware" records that are assigned to the current logged in user so that if he chooses another "caller" he can see that he has "hardware" assigned to him but cant see the details of that "hardware".

Can anyone help with this ?

1 ACCEPTED SOLUTION

Hi @F_bio Santos

As per my understanding, the Hardware variable to referencing to CMDB table ( or child table ) where some CIs ( like laptop, desktop, mobiles etc. ) are assigned to users.

 

logically, if hardware variable to reference type and you are fetching data and setting to variable then preview icon ( i ) will visible and user can click for more details.

 

If you make this hardware variable as single-line text and fetch the data using some backend script and set the value then no one check the hardware data details.

 

alternatively you can have both type field on form and set the visibility based on logged in user or other user and display the desire variable on form only. 

 

-Thanks,
AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

View solution in original post

7 REPLIES 7

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @F_bio Santos 

Yes, I mean like the "i" icon on the reference field we have in the native view. 

 

https://www.servicenow.com/community/itsm-forum/reference-field-pop-up-form-in-service-portal-for-us...

https://www.servicenow.com/community/developer-forum/how-to-add-icon-in-the-reference-field/m-p/2245...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Yes its about the "i" icon, but they only want it to appear if the record that they select, is assigned to the logged in user

I am not that expert in code mate, so what i got i shared. @Sandeep Rajput  @AshishKM  any help here.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

So I talked with the client and their request was actually much simple than what I tought, they first said that they wanted the users to see each other hardware but the "i" only if the record was assigned to them, but they said that if the users can only see their records its better, so I just need to put a filter on the variable "assigned_to > is dynamic > me". 

Thank you anyway for the help, but if @Sandeep Rajput or @AshishKM know a solution for the first request it would be perfect, it may be a actuall need in the future.