Filter Layer by Portal Login

534
3
09-13-2019 12:26 PM
KeithGerhartz1
Occasional Contributor II

I would like to display only records that have an associated portal user by default when an app is opened. This would be analogous to the functionality of Workforce as it show only the work orders that are assigned to a user. Has anyone had experience doing this?

0 Kudos
3 Replies
shaylavi
Esri Contributor

I assume you want this to happen when the user loads the application.. Sounds like you'll need a custom query task that injects the user details in the where statement for each layer.

I'm manipulating the layers a bit when loading the application but it's a very custom solution. I manage that code at the jimu.js/mapmanager.js file just when it loads the layers.

You can iterate them and apply the filter with the FilterManager object after grabbing the user details (which should be available once you limit the access to the resource)

Shay.

Shay
0 Kudos
KeithGerhartz1
Occasional Contributor II

Thanks for the reply. Thinking about making this a configurable widget ...

0 Kudos
LouisDECOMBE
Occasional Contributor

Hi Keith,

I'm interesting about your configurable widget or any solution to filer layer by arcgis portal username. 

0 Kudos