Select to view content in your preferred language

A dynamic filter based on logged username

467
0
07-28-2023 02:59 AM
rajeshmenda1
New Contributor

I had a map consists of 3 feature classes. Among all the feature classes there is common field named 'user' and this user field contains values     'user1',

                                                         'user2',

                                                         'user3'

Finally, I published this map and I created following 3 members with usernames 'user1', 'user2', 'user3'.

Whenever 'user1' login with his profile. He has to see only the features that contains 'user1'. 

Following is the Arcade expression I had written and tested in a web map in pop up section. Whenever I clicks the run tool, I'm getting the output:

var user = GetUser($layer)
var current_user = user.username
var fs = FeatureSetByName($map, "layer name",['*'],true)
var filtered = Filter(fs, "field name (user) = @current_user")
filtered 

 

If anyone understands my situation, please help me

 

 

 

0 Replies