cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

How to set a message to PowerApps form user

In my Sharepoint Online site ( Office 365, see below screenshot), a PowerApps form is placed in right side. This form is available to users in the ContactEmail List.  I want to have a message to show up when someone is not in " ContactEmail " list, say " you are not have access to this form". I tried to edit the code of front page ( as below) to get it, but not working. Anyone has better idea? Thanks

 

 

SortByColumns(Filter([@'Test form'], StartsWith(Title, TextSearchBox1.Text) && SPUser = ContactEmail), "Title", If(SortDescending1, Descending, Ascending))

 

page.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to set a message to PowerApps form user

Hi  @Anonymous ,

 

Do you mean only users in ContactEmail list have access to the data?

Is there a Person/Group column in ContactEmail list to store users?

If users are not in ContactEmail list, it just shows the Message "you don't have access to this form", right?

 

1. modify Visible property of Gallery, check if the login user is in ContactEmail list

 

If(User().Email in AddColumns(ContactEmail,"UserEmail",'Person Column'.Email).UserEmail,true,false) // Modify the 'Person Column' to yours

 

2. create a Label, set Text: "You don't have access to this form", modify the Visible property:

 

If(User().Email in AddColumns(ContactEmail,"UserEmail",'Person Column'.Email).UserEmail,false,true) // Modify the 'Person Column' to yours

 

3. modify the Items property of Gallery:

 

SortByColumns(Filter([@'Test form'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

Then, If the current user is in the ContactEmail list, the gallery shows, if the current user is not in the list, the Message label shows.

Hope this helps.

Sik

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: How to set a message to PowerApps form user

Hi  @Anonymous ,

 

Do you mean only users in ContactEmail list have access to the data?

Is there a Person/Group column in ContactEmail list to store users?

If users are not in ContactEmail list, it just shows the Message "you don't have access to this form", right?

 

1. modify Visible property of Gallery, check if the login user is in ContactEmail list

 

If(User().Email in AddColumns(ContactEmail,"UserEmail",'Person Column'.Email).UserEmail,true,false) // Modify the 'Person Column' to yours

 

2. create a Label, set Text: "You don't have access to this form", modify the Visible property:

 

If(User().Email in AddColumns(ContactEmail,"UserEmail",'Person Column'.Email).UserEmail,false,true) // Modify the 'Person Column' to yours

 

3. modify the Items property of Gallery:

 

SortByColumns(Filter([@'Test form'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

Then, If the current user is in the ContactEmail list, the gallery shows, if the current user is not in the list, the Message label shows.

Hope this helps.

Sik

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (7,434)