Skip to main content

Hello All,

 

How can I get drop down list of unique managers with their display name as display in one of my view.  I am able to get list of managers from GetUsers AD smart object but it shows duplicate names. Does any one know how to get unique list or know of any other better way. I basically want to show users dropdown list of all the supervisor in my form.

 

Thank you

 

Hi,


 


Currently there is no way to filter out any duplicate values from your SmartObject's list method. The only workaround I can think of is to create a stored procedure in your SQL database, to query and display unique values. Then create a SmartObject from that stored procedure.


 


However, you cannot do that with AD SmartObject. Alternatively, all your users' info should also be cached in a K2 database table called [Identity].[Identity]. From there, you can


 



  1. Create a stored procedure to query that table, and display unique values

  2. Register a SQL Server Service instance to the K2 database

  3. Create a SmartObject from the stored procedure you just created

  4. And finally, use that SmartObject in your form


However, please avoid writing to any of the K2 database tables. It should be alright if you just try to read from the tables.


Thank you. This table does not show me if user is supervisor however this will be helpful for future needs

Thanks again


Reply