cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joef
Level 8

browse galery display my teams entries

Hi all,

Happy Holidays!!!!

 

In the Items of the browse gallery, I am filtering the data so only the current user see their own entries for the past 30 days. 

The App is on top of an SPO list.

Now the Managers want to see their teams entries, and requested that everyone on their team to be able to see their teams entries. 

 

1) Is there a way to use groups so that a member of group A can see whatever was entered by any of the members?

     a) can I use an AD group, or should it be a SPO group?

2) How can I change the default sort to be deposit date instead of Title?  I tried changing it in the function below, but it keeps erroring and does not like it when i change the title...

 

I am using:

SortByColumns(Filter([@'Edison Deposit Entry'], StartsWith(Title, TextSearchBox1.Text),'Created By'.DisplayName = CurrentUser,Created >= DateAdd(Now(),-30,Days)), "Title", If(SortDescending1, Descending, Ascending))

 

Thanks,

Joe

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: browse galery display my teams entries

Hi @joef ,

Q1:

Do you want to filter items that person who belong to the same group with current user?

If so ,please try Office365 Groups connector.

Using this connector, you could get value about group.  (AADgroup)

I've made a similar test for your reference:

1)set the screen's OnVisible:

ClearCollect(group,
            ForAll(Office365Groups.ListOwnedGroups().value,  
                     //get all the groups that current user belongs to
                   Office365Groups.ListGroupMembers(id)
                   ) 
                    //list all the members that those groups have
             );
Clear(emailcollection);ForAll(group,Collect(emailcollection,value.mail))
//get all the members' email (get value from nested table)

You could refer these docs:

https://docs.microsoft.com/en-us/connectors/office365groups/

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/How-to-access-nested-table-values/t...

 

2)filter based on this connection:

Filter(listname,personfield.Email in emailcollection.mail)

 

Q2:

If you want to sort based on date, you could just use date as sort order.

Try this formula:

SortByColumns(Filter([@'Edison Deposit Entry'], StartsWith(Title, TextSearchBox1.Text),'Created By'.DisplayName = CurrentUser,Created >= DateAdd(Now(),-30,Days)), "Date", If(SortDescending1, Descending, Ascending))

 

If you have errors, please show me error message.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support Team
Community Support Team

Re: browse galery display my teams entries

Hi @joef ,

Q1:

Do you want to filter items that person who belong to the same group with current user?

If so ,please try Office365 Groups connector.

Using this connector, you could get value about group.  (AADgroup)

I've made a similar test for your reference:

1)set the screen's OnVisible:

ClearCollect(group,
            ForAll(Office365Groups.ListOwnedGroups().value,  
                     //get all the groups that current user belongs to
                   Office365Groups.ListGroupMembers(id)
                   ) 
                    //list all the members that those groups have
             );
Clear(emailcollection);ForAll(group,Collect(emailcollection,value.mail))
//get all the members' email (get value from nested table)

You could refer these docs:

https://docs.microsoft.com/en-us/connectors/office365groups/

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/How-to-access-nested-table-values/t...

 

2)filter based on this connection:

Filter(listname,personfield.Email in emailcollection.mail)

 

Q2:

If you want to sort based on date, you could just use date as sort order.

Try this formula:

SortByColumns(Filter([@'Edison Deposit Entry'], StartsWith(Title, TextSearchBox1.Text),'Created By'.DisplayName = CurrentUser,Created >= DateAdd(Now(),-30,Days)), "Date", If(SortDescending1, Descending, Ascending))

 

If you have errors, please show me error message.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

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
Users online (5,003)