cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
santpaiva
Helper I
Helper I

Button visible only to a specific user

 

Hello everyone!

I have an SP List of products and one of the columns is for the seller who sold that merchandise.
In the app, I have a screen with the Form of this list, with several DataCardValue with the information of the products, including the name of the seller, this screen can be accessed by several people.
However, now I want a button that is only visible to the seller of that product and the manager.
At first I tried this in Visible: "If (Lower (DataCardValue_seller_name.Text) = Lower (User (). FullName); true, false)"
Where "DataCardValue_seller_name" is the card of the form that contains the name of the seller responsible for the sale.
This function only recognizes False, can someone help me?
4 REPLIES 4
eka24
Super User
Super User

Your formula give an impression that the loged in users name is the same as the sellers name. is that the case?

 

if that is not the case and you have the username as one of the columns, do the following OnStart;

 

Set(LoggedSeller, LookUp (Datasource, usernameColumn=User().FullName, SellerColumn)

 

Then in the Visible of the Button;

 

If (Lower (DataCardValue_seller_name.Text) = Lower (LoggedSeller); true, false)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Thanks for the answer.
Unfortunately it didn't work. I just want to confirm that the name on the DataCard is the same as the name of the user who is logging in to the App, and if it is the same, the button will be visible.
I tried your suggestion but it doesn't work.
Why doesn't my code work? "If (Lower (DataCardValue_seller_name.Text) = Lower (User (). FullName); true, false)"
Any suggestion?

I have seen ; in your code instead of ,

So change the code to ;

Lower( Trim(DataCardValue_seller_name.Text)) = Lower (Trim(User ().FullName))

 

Or

Lower (DataCardValue_seller_name.Text) = Lower (User ().FullName)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

I Tried
"if (Lower (DataCardValue_seller_name.Text) = Lower (User () .FullName), true, false)"
But he accuses invalid argument within the Lower. The only way to make sure there is no error is to insert the SearchText in "Lower (DataCardValue_seller_name.SearchText)", in this there is no more error but the comparison of the words is not correct, it is always calculates False even when they are the same words.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,896)