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

How to preselect data from dataset for multiple Apps

Hi

I have a Sharepoint List with All Department's employee information in it.   However, I'd like to create multiple Apps that can be preset to ensure that only chosen Departmental information is visible.

For instance, Depts 1,2,3,4 and each head of dept should only be able to see their employee's information i.e. Head of Dept for 1 & 2 should not be able to see any data for employees under department 3 and 4. I currently have a column labelled Departments which lists all relevant departments in it, so perhaps a solution that would allow me to deselect those for each App where relevant.?

Thanks Marie

16 REPLIES 16
Highlighted
Super User III
Super User III

Hi @MarieBainbridge ,

Why do you want multiple apps? You can simply filter the department based on the logged-in user. A reference list is the best way of doing this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted

Hi ya,

 

That sounds great!  How do i do that please 🙂

 

M#

Highlighted

Hi @MarieBainbridge ,

Make a SharePoint list with the Department Head's email address and Department. I will call the List RefList and the fields HeadEmail and Department below

Then at App OnStart

Set(
   vUserMail,
   User().Email
);
Set(
   vDept,
   Lookup(
      RefList,
      HeadEmail=vUserMail,
      Department
   )
)

You would then filter the gallery (assuming the field name is Department)

Filter(
   YourSPList,
   Department=vDept
)

and they would see only the records from their department.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted

Hi @MarieBainbridge ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted

Hi sorry, I've had my head in the other day job #finance.....

 

However, back to the fun job; we have the 'person' option within Sharepoint List items; could I replace the email address with Person?  Could the formula be adapted to that as it's easier to select Person's than enter in emails plus it stops email address errors for users, pretty please?  In the meantime I'll try the email formula as it'll be good to learn it for sure.

 

Thank you


Marie

 

 

 

Highlighted

Hi again,

 

I've managed to use the Person element and to have the Work Email address show.... hoping this is an option as it's easy to set up?

 

Thanks

 

M#

Highlighted

btw; do i have to add my own email address as owner/administrator of the App too?

Highlighted

Hey...

 

I've created a brand new SharePoint List, added it to the App through Connections, now I've got the following info with a little issue (think it doesn't like the = )  The SharePoint List is called Access Rights and the Office 365 profile user details is labelled 'Person' and I've got the 'show work email' for this column.  Then I've got the Department column with multiple choice as some Person's need access to more than one dept info.

 

Set(vUsermail,User().Email);
Set(vDept,LookUp(AccessRights,Person=vUsermail,Department))

 

I'm now looking to see where i put the filter information as I've selected the Browse Gallery; do i put it in Data Items before the following info that's already in there?

 

SortByColumns(Filter([@'Property Information'], StartsWith(Address, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

As in :

 

Filter(AccessRights,Department=vDept), SortByColumns(Filter([@'Property Information'], StartsWith(Address, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

Many thanks 🙂

 

M#

Highlighted

Hi @MarieBainbridge ,

Firstly

Set(vUsermail,User().Email);
Set(
   vDept,
   LookUp(
      AccessRights,
      Person=vUsermail,
      Department
   )
)

will certainly return the department of the user logged in.

The Filter - assuming the field in 'Property Information' is also called Department

SortByColumns(
   Filter(
      [@'Property Information'], 
      StartsWith(
         Address, 
         TextSearchBox1.Text
      ) && Department=vDept), 
   ), 
   "Title", 
   If(
      SortDescending1, 
      Descending, 
      Ascending
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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