cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TCH
Level: Powered On

Displaymode Condition

Hi guys, 

 

I have build an app for ordering items. In this app there is an "order" button, that should have its displaymode set to either disabled or edit based on a condition. 

 

The app is connected to a SharePoint list, this list holds all of the information on the employees that should be able to order items, in other terms: if they are in the list they should be able to order, but if they are not, they should not be able to order. 

However i am having issues with this, as it only works for some, some of the people in the list it is almost like it does not recognise them and therefore does not allow them to order even though they should be allowed to. 

Right now the condition for the button is set to: 

If(User().FullName in MedarbejderNr.Navn;DisplayMode.Edit;Disabled)

 

This works fine for the majority of people, however for some it does not. 

Here is an example of this: 

Here you can see what the name looks like in the Active Users section in the admin center e.g. the User().Fullname and underneath what it looks like in the SP list that it needs to compare it to, exactly the same, so i am a bit confused about why it won't work for her. I have also tried clearcollecting the list and loading it in the app instead, still is the same issue? 

Aktive brugere.PNGMedarbejdernummer liste sp.PNG

To elaborate a little bit the app needs to do a lookup: 

LookUp(MedarbejderNR;Navn = User().FullName;Nr)


Here it mathces the name with the name in the list an writes the number that is corresponding with that name. This is essentially the whole point, if it cannot fetch their number they should not be allowed to order. 

Does anyone have an idea of how to resolve this, or redevelop/design it? 

Thanks in advance 
Tobi 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Displaymode Condition

@TCH 

I think you are on the right track with LOOKUP.  Have you tried this idea yet?

If(
    IsBlank(LookUp(MedarbejderNR;
                Navn = User().FullName,
                DisplayMode.Edit;
                DisplayMode.Disabled
    )
)

 

Also, I tend to do LOOKUPs on User().Email instead.  I find it more reliable than names and there are guaranteed no duplicates.  Have you considered this approach?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 ---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Community Support Team
Community Support Team

Re: Displaymode Condition

Hi @TCH ,

Could you please share a bit more about the "Navn" column in your MedarbejderNr SP List? Is it a Text type column?

Do you want to check if the current user is existed in your MedarbejderNr SP List?

 

I have made a test on my side, please consider take a try to modify your formula as below:

Set the DisplayMode property of the "Order" button to following:

If(
   IsBlank(LookUp(MedarbejderNr; Navn = User().FullName));
   DisplayMode.Disabled;
   DisplayMode.Edit
)

or

If(
   IsBlank(LookUp(MedarbejderNr; Navn = User().FullName; Nr));
   DisplayMode.Disabled;
   DisplayMode.Edit
)

Please check if the Full name of the users having this issue are actually existed in your MedarbejderNr list. You could add a Label in your app, set the Text property to following:

User().FullName

then compare the displayed result with the Navn column value in your MedarbejderNr list, check if the current sign in user is exited.

Note: Please make sure each word of the name in your MedarbejderNr list is the same as that in your Office 365 Admin Center -- Active Users.

 

In addition, as an alternative solution, you could consider add a Person type column in your SP List to store the user rather than use Text type column. Then you could modify your formula as below:

If(
   IsBlank(LookUp(MedarbejderNr; PersonColumn.Email = User().Email));
   DisplayMode.Disabled;
   DisplayMode.Edit
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Super User
Super User

Re: Displaymode Condition

@TCH 

I think you are on the right track with LOOKUP.  Have you tried this idea yet?

If(
    IsBlank(LookUp(MedarbejderNR;
                Navn = User().FullName,
                DisplayMode.Edit;
                DisplayMode.Disabled
    )
)

 

Also, I tend to do LOOKUPs on User().Email instead.  I find it more reliable than names and there are guaranteed no duplicates.  Have you considered this approach?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

 ---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Community Support Team
Community Support Team

Re: Displaymode Condition

Hi @TCH ,

Could you please share a bit more about the "Navn" column in your MedarbejderNr SP List? Is it a Text type column?

Do you want to check if the current user is existed in your MedarbejderNr SP List?

 

I have made a test on my side, please consider take a try to modify your formula as below:

Set the DisplayMode property of the "Order" button to following:

If(
   IsBlank(LookUp(MedarbejderNr; Navn = User().FullName));
   DisplayMode.Disabled;
   DisplayMode.Edit
)

or

If(
   IsBlank(LookUp(MedarbejderNr; Navn = User().FullName; Nr));
   DisplayMode.Disabled;
   DisplayMode.Edit
)

Please check if the Full name of the users having this issue are actually existed in your MedarbejderNr list. You could add a Label in your app, set the Text property to following:

User().FullName

then compare the displayed result with the Navn column value in your MedarbejderNr list, check if the current sign in user is exited.

Note: Please make sure each word of the name in your MedarbejderNr list is the same as that in your Office 365 Admin Center -- Active Users.

 

In addition, as an alternative solution, you could consider add a Person type column in your SP List to store the user rather than use Text type column. Then you could modify your formula as below:

If(
   IsBlank(LookUp(MedarbejderNr; PersonColumn.Email = User().Email));
   DisplayMode.Disabled;
   DisplayMode.Edit
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,505)