cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

Highlighted
luisep
Level: Powered On

Re: Create table/gallery when all items match

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

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,826)