How to hide a UX View from particular department

In my equipment maintenance app, I have column, named department and it has maintenance and production rows and I need to hide a UX view for the production department, but it should be visible for maintenance department, also this should come in action from the login page itself( My login page consists of Username, Password, Department (with is automated, as soon as I enter the name it automatically recognizes the Department)).Moreover, I also tried show if constraint IF(("Details"[Department])=Maintenance, "true", "false")

0 5 143
5 REPLIES 5


@Nani wrote:

 IF(("Details"[Department])=Maintenance, "true", "false")


This expression doesn't make sense.  First I am not sure you can place table names in quotes.  Never tried it so I am not sure but because you are NOT getting an expression syntax error, I suspect not.

Regardless, it wouldn't matter, Details[Department] returns a LIST and you cannot compare a LISt to a single text value of "Maintenance".

What you need is the [Department] value for the logged in user to compare with. 

As an example, many of us will create a "CurrentUser" Slice - a single row of the currently logged in user that could also contain the user's department.  We would then access this Slice in the Show_If to hide/show the view like this:

ANY(CurrentUser[Department]) = "Maintenance"

CurrentUser[Department] returns a LIST of values also BUT since we know its only a single row for the current user - we get a LIST of a single value.  Then we can use the ANY() function - which returns the first value (in this case the only value) in the list.

The question for you is...How do you get the department value for the current logged in user?

The above expression is not working. The View which should not be visible to Maintenance department should be visible to production department, but here the view is not getting visible for both the departments if I am using the above expression.


@WillowMobileSys wrote:

The question for you is...How do you get the department value for the current logged in user?


 

You need to answer this question previously asked.

I don't expect the example expression to work for you.  As described, it was just to show what SOME do to handle criteria for logged in users.  

You will need to do something similar but exactly what will depend on what you have implemented so far.

FYI, more resources regarding the techniques that @WillowMobileSys references: SUMMARY TIP: User permissions, roles, and settings

Firstly, I have created a login page through user settings which consists of username, password and department, then I have given LOOKUP() expression in the app formula.

Top Labels in this Space