Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
fmonetti
Contributor
Contributor

Automatic filters when you open an App

Hi. I need to publish an application that contains user data. For the access level I need that:

  • If the user who enters is one on which the application contains data, bring the "User" field that is available in the app filtered by that user (just the filter applied,  does not filter the model data)For example, if i'm the user Arregui, 

    When I enter the application, the "User" filter should be applied, but it should allow me to modify it and see all the data of the model

Capture.JPG

  • If the user who enters is NOT in the list of users in the "User" field available in the app, do not apply this filter

Capture2.JPG

I hope you can help me. Thank you very much

@sguerra2 

FM
4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi, You can do this using the Dynamic Bookmark Option.

Check this and try. 

https://www.youtube.com/watch?v=tFyqOigqnUw

Let me know if you need further help.

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
fmonetti
Contributor
Contributor
Author

thanks @kaushiknsolanki ! I think we could use this option, but I don't know how to make the formula inside the field to obtain the filter of the user who is entering

FM
Levi_Turner
Employee
Employee

That video points to the approach, but to give a concrete example. My userid is ltu

My sample model:

data:
LOAD * INLINE [
user,value
ltu,1
foo,2
];

 

The system function which exposes the user's identity is =OSUser() which formats the response as UserDirectory=MyUserDirectory; UserId=MyUserId.

 

You can wrap this in the SubField function to focus on just the MyUserId value like so: =SubField(OSUser(), '=',3)

 

From there you can write an expression (using this example) of =user=SubField(OSUser(), '=',3)

sguerra2
Contributor II
Contributor II

Hi @Levi_Turner ! I am working together with @fmonetti . We tried your suggestion.. and it is working to choose the selection, however we are still having issues when we setup the bookmark to set is as default-

I setup a bookmark with two fields

Month: Using the expression: =[Base iCall-1.fecha.autoCalendar.YearMonth] = Monthstart(now())

User: using the expression: =user=SubField(OSUser(), '=',3)

The issue is that when i set the bookmark the selection it does is: 

{<[Base iCall.Mes]={'Octubre'},[USER ID]={'sguerra'}>}  and for instance if i share the app to other user, they can see my info, when the bookmark should be filtering by their own username.... not sure if we setting the bookmark incorrrectly :S 
 
Could you please help us?
Thanks,
Sofía