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

Hide Label/Link based on condition

Hello!

 

I have a label(that's actually a button) named "Register". Users who click on the label are taken to a page in the PowerApp where they type their first and last name in the textbox. When they click the Submit button, it creates a item(row) in SharePoint.  I want to make sure they can only write to this list once.

 

I was thinking that maybe "If (lookup, SPlist, User().FullName = "SPlist".Title", false, true)" should be in the Visible property for the label. "If their is a First and Last name in the Title field already in the Sharepoint List that matches the logged in user (User().FullName), the Register button isnt available"

 

Hope this makes sense!

1 REPLY 1
EricLott
Level 10

Re: Hide Label/Link based on condition

You would want to do something like this (no need for an if statement):

 

LookUp(Splist,User().FullName=SPlist.Title,Title)<>Blank()

 

You could also store the user's ID in the SharePoint list to make this a little more straightforward. 

 

Office365Users.MyProfile().Id

 

Also, just a thought, instead of altering the Visible property, you could make it do something like this on the registration button's OnSelect() function, which is a little more user friendly. It will notify the user that they have already registered instead of the control just disappearing.

 

If(LookUp(Splist,User().FullName=SPlist.Title,Title)<>Blank(), Navigate(YourRegistrationForm), Notify("You have already registered.",NotificationType.Information))​

 

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,952)