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

Display Line Items only from User who created form

Good morning everyone,

 

Hope all is well. I am having an issue this morning with one of my galleries and the issue is trying to display the forms info of the user who created the form. Whenever I have a VP create a Job Requisition form they should only be able to see the form's they created, but they are seeing all the forms created by the other VP. How would I be able to get the gallery to only display the forms created by that user? I am going to attach an image of the picture and the code I have of the items. 

 

AllRequest.PNGItemsAllRequest.PNG

 

Thanks for the help!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Display Line Items only from User who created form

@Ajilakes 

Okay...let's review a few things here:

1) Have to state this in case you are not aware...filtering and hiding data from your SharePoint list does NOT keep people from actually accessing the information in other records. Although your App may obscure the data, the fact that a user has to have access to the list to be able to read and write to it means that they have access to every record.  IF you want to control this, the only option you have in SharePoint is to enable Item-Level permissions in the SharePoint list advance settings.  However, this changes the list.

 

2) Your filter, regardless, is not working properly.  Let's try a couple things:

a. change the filter part of your formula so we're comparing apples to apples to the following:  

   ..lumns(Search(Filter('Job Requisition Form List', Lower('Created By'.Email) = Lower(UserEmail)), TextInputSear...

b. Place another test label in your gallery and set the text to : ThisItem.'Created By'.Email

c. Place a test label somewhere on your screen and set the text to: UserEmail

What we're looking for is (hopefully success in a.) a list that shows the created by column and another label that shows the user email value you have in your variable.  Compare those two and make sure things look proper.

 

Let's start with that and see where that leads us.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

5 REPLIES 5
Super User
Super User

Re: Display Line Items only from User who created form

@Ajilakes 

You can filter the information based on the current user.

Your formula would become this:

SortByColumns(
     Search(
         Filter('Job Requisition Form List', 'Created By'.Email = User().Email),
         TextInputSearch.Text,
         "Title", "EmployeeName", "Requetor"),
    SortColumn,
    If(SortDescending, Descending, Ascending)
)

Only the items created by the current user (based on email address) will be searched and therefore displayed.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Ajilakes
Level: Powered On

Re: Display Line Items only from User who created form

Hi @RandyHayes ,

 

I was able to get the filter set, but the user is still able to see the request created. I tried the way you provided, but it never displayed any items. Is their something I am doing wrong?

I will attach the image of the update Job Request

 

UpdateAllRequest.PNG

Super User
Super User

Re: Display Line Items only from User who created form

@Ajilakes 

Is UserEmail set somewhere in your app to User().Email?  And if so, is it getting set.

Next point - you had stated about users only being able to see items that they created.  Normally in SharePoint, every record contains a Created By column that records who created it.  Using this column in your filter and comparing to the current user will be sufficient to filter only records they have created.

However, given the above statement - if you are somehow recording or identifying the creator of the record within your data in another column, then you can certainly use that in your filter instead.

I cannot determine from your picture which column it is that you are expecting to be based on the current user. Are you looking at the Employee Name or Requestor as your indicator of success or failure?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Ajilakes
Level: Powered On

Re: Display Line Items only from User who created form

Hi @RandyHayes .

 

We have the UserEmail set up in the beginning by displaying the user's info who's going to create the Form. I am going to attach an image of the OnVisible Code I have for that page. I am doing everything you told me, but when I create a form in the app other users are able to see what I created. 

 

On the other screen is where the gallery is displayed and what we want to do here is whenever the user creates a Form; that form appears for the user and not for everyone else. The forms that are displayed have to be matched to the user creating the form and they are not allowed to see any other forms created by other users. 

 

If you can assist me with this that would be great! Look forward to your response,

 

NewAllRequest.PNGSPInfo.PNGUserInfo.PNG

Super User
Super User

Re: Display Line Items only from User who created form

@Ajilakes 

Okay...let's review a few things here:

1) Have to state this in case you are not aware...filtering and hiding data from your SharePoint list does NOT keep people from actually accessing the information in other records. Although your App may obscure the data, the fact that a user has to have access to the list to be able to read and write to it means that they have access to every record.  IF you want to control this, the only option you have in SharePoint is to enable Item-Level permissions in the SharePoint list advance settings.  However, this changes the list.

 

2) Your filter, regardless, is not working properly.  Let's try a couple things:

a. change the filter part of your formula so we're comparing apples to apples to the following:  

   ..lumns(Search(Filter('Job Requisition Form List', Lower('Created By'.Email) = Lower(UserEmail)), TextInputSear...

b. Place another test label in your gallery and set the text to : ThisItem.'Created By'.Email

c. Place a test label somewhere on your screen and set the text to: UserEmail

What we're looking for is (hopefully success in a.) a list that shows the created by column and another label that shows the user email value you have in your variable.  Compare those two and make sure things look proper.

 

Let's start with that and see where that leads us.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Demo Extravaganza Championship Voting Open

Voting Ends: October 30, 2019!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 343 members 5,481 guests
Please welcome our newest community members: