Show users list in portal with search option

Feddy
Kilo Sage

Hi Team , 

We have a requirement to show list of users (changes based on logged in user profile) in portal and allow users to search within the list. We also would like to redirect to user profile when they click any user record on the list. 

Do we have any OOB widget we can take reference from ?

Any input on this would be much appreciated.


Thanks, 
Fedrick

7 REPLIES 7

Anil Lande
Kilo Patron

Hi,

As per my knowledge there is no OOB widget for such functionality.

You can build custom widget to achieve your requirement. Where exactly you want this feature? On any form or in a Portal page using custom widget?

 

Thanks,
Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

SumanthDosapati
Mega Sage
Mega Sage

Hi,

There is no such OOB widget.

You need to create a custom widget for the same.

 

Regards,
Sumanth

Gaurav Rotke1
Kilo Guru

Hi Feddy,

You can refer below code, but you might need to make some changes in it.

html:
<div class="container">
  <h1>
    User's List:
  </h1>
  <table border= "1.5px solid black">
    <tr>
      <th>User ID</th>
      <th>First Name</th>
      <th>Last Name</th>
      <th>Email</th>
    </tr>
    <tr ng-repeat="x in data.list">
      <th>{{x.id}}</th>
      <th>{{x.fname}}</th>
      <th>{{x.lname}}</th>
      <th>{{x.email}}</th>
    </tr>
  </table>
</div>

 

server:
(function() {
  /* populate the 'data' object */
  /* e.g., data.table = $sp.getValue('table'); */
    
    var gr= new GlideRecord('sys_user');
    gr.addNotNullQuery('user_id');
    gr.query();
    
    var id, fname, lname, email;
    data.list=[];
    
    while(gr.next()){
        var out={};
        out.id=gr.getValue('user_name');
        out.fname=gr.getValue('first_name');
        out.lname=gr.getValue('last_name');
        out.email=gr.getValue('email');
        data.list.push(out);
    }

})();

 

If its helpful to solve your requirement please mark helpful.

Thank you

Gaurav Rotke

Mohith Devatte
Tera Sage
Tera Sage

hello @Feddy ,

i think you can use "Data table from URL definition"  OOB widget where you will be able to search for the users and you can click on the record it will be redirected to user profile form like below 

find_real_file.png

find_real_file.png

please mark my answer correct if it helps you