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

Create table/gallery when all items match

Hello,

I hope someone can help me.
I have an SP List, with several columns. In one of these columns, named "Status", all records initially appear as "pending preparer".


Through a form, the records are completed and the status becomes "pending authorizer".

 

I would like to create a table or gallery, when all the records in that list become "pending authorizer". If there is any record left as "pending preparer", that table / gallery should not be created / displayed.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-siky-msft
Microsoft

Re: Create table/gallery when all items match

@luisepI get it. I have tested on my side, please try this:

Clear(MyCollection);ForAll(Distinct('SP list','Co.'),If(CountRows(Distinct(Filter('SP list','Co.'=Result),Status))=1 && First(Distinct(Filter('SP list','Co.'=Result),Status)).Result="Pending Authorizer",Collect(MyCollection,Filter('SP list','Co.'=Result))))

 Snipaste_2020-01-14_11-39-21.pngSnipaste_2020-01-14_11-39-49.png

Sik

View solution in original post

7 REPLIES 7
Super User
Super User

Re: Create table/gallery when all items match

Hey @luisep, in reading your issue I had a thought that may work for you. What I would do would be to create a table/gallery for the list that is filtered by Status = "pending authorizer". I would then set the Visible property to:

CountIf(listName, Status = "pending authorizer") = Count(listName.ID)

Essentially, the table/gallery would contain only items with a "pending authorizer" status and would only be visible when the count of rows in the list is the same as the count of rows with the proper status in the list.

 

Let me know if that gets you going in the right direction or not; I'd be happy to follow up if needed!

Microsoft v-siky-msft
Microsoft

Re: Create table/gallery when all items match

Hi @luisep ,

 

What is the column type of Status? Choices?

Take Gallery as an example, if Status column is choices type, first set the OnVisible property of screen as below:

 

ClearCollect(MyCollection,ForAll('SP list',"pending preparer" in Status.Value))

 

Set Visible property of Gallery as below:

 

If(true in col1,false,true)

 

Then, the gallery will be invisible if there is any "pending preparer" value in the records.

Sik

luisep
Level: Powered On

Re: Create table/gallery when all items match

Hi,

Thank you for your answers.

I enclose an example of my SP List: I have 3 different companies, 5 points for each company and finally a status (as text format).

In the example, companies 1 and 3 have all points as "Pending Authorizer", but company 2 still has points 2, 3 and 4 as "Pending Preparer".

For all of this, I'd want that gallery could display only company 1 and 3.

 

Thanks in advance.

Microsoft v-siky-msft
Microsoft

Re: Create table/gallery when all items match

Hi @luisep ,

 

Does your logic mean you want to filter out records that all company point is in pending prepare status?

If so, please check the following steps.

1. Put the following codes to OnVisible property:

 

Clear(MyCollection);ForAll(Distinct('SP list','Co.'),Collect(MyCollection,Filter(Filter('SP list','Co.'=Result),Status="pending preparer")))

 

2. set Items property of gallery to MyCollection

then the gallery will only display records that all company point is in pending prepare status.

Sik

luisep
Level: Powered On

Re: Create table/gallery when all items match

Hi @v-siky-msft 

I've followed the steps you have indicated, but the result of the gallery is all the rows that contain "Authorizer pending".


The idea is if Company-1 has 5 "Pending Authorizer", that Company-1 has to appear in the gallery. If Company-1 has less than 5 that does not appear in the gallery.

 

Kind regards

Microsoft v-siky-msft
Microsoft

Re: Create table/gallery when all items match

@luisepI get it. I have tested on my side, please try this:

Clear(MyCollection);ForAll(Distinct('SP list','Co.'),If(CountRows(Distinct(Filter('SP list','Co.'=Result),Status))=1 && First(Distinct(Filter('SP list','Co.'=Result),Status)).Result="Pending Authorizer",Collect(MyCollection,Filter('SP list','Co.'=Result))))

 Snipaste_2020-01-14_11-39-21.pngSnipaste_2020-01-14_11-39-49.png

Sik

View solution in original post

luisep
Level: Powered On

Re: Create table/gallery when all items match

@v-siky-msft thanks a lot for your solution.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,800)