cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Applicable88
Advocate II
Advocate II

Getting all records of the gallery, not only the first one

Hello, 

I have a inputtextfield where I search for ordernumbers in sp list. I have a gallery which is based on that list (tblOrders) and it displays all those records according to that filter:

Filter(tblOrders; Ordernumber = TextInput1_1.Text)

Ordernumbers are not necessarily distinct. For one ordernumber I might get several records. I add another label with: 

Applicable88_0-1675333189645.png

I have a true false check column (columnB). Whenever I got a records, where in Column A is no string of "PDF" than I get false. 

When there is at least one false in the result, I want the whole gallery result to be patch into a collection called "colOrdernumber. 

I used following. 

Collect(colOrdernumbers;Gallery.AllItems)

But seemingly the formular only works on the first row of a gallery, not on all rows. How to get all records of a result which has a least one "false" in columnB.

 

Thank you very much in advance.

Best. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Applicable88 ,

 

I made a sample for you.

vxiaochenmsft_0-1675391177823.png

vxiaochenmsft_1-1675391194861.png

Filter(LIST301,Ordernumber=TextInput1.Text)

vxiaochenmsft_2-1675391214212.png

vxiaochenmsft_3-1675391226060.png

If(CountRows(Filter(AddColumns(Filter(LIST301,Ordernumber=TextInput1.Text),"temp",If(ThisRecord.Title="PDF", true , false )),temp= false ))>0,Collect(Col,Filter(LIST301,Ordernumber=TextInput1.Text)))

 

Best Regards,

Wearsky

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @Applicable88 ,

 

I made a sample for you.

vxiaochenmsft_0-1675391177823.png

vxiaochenmsft_1-1675391194861.png

Filter(LIST301,Ordernumber=TextInput1.Text)

vxiaochenmsft_2-1675391214212.png

vxiaochenmsft_3-1675391226060.png

If(CountRows(Filter(AddColumns(Filter(LIST301,Ordernumber=TextInput1.Text),"temp",If(ThisRecord.Title="PDF", true , false )),temp= false ))>0,Collect(Col,Filter(LIST301,Ordernumber=TextInput1.Text)))

 

Best Regards,

Wearsky

@v-xiaochen-msft thank you very much! That should work for me. I wonder why all my approaches with patch and filter didn't work before, but here you doing a temprorary "addcolumns" and also a "countrows" of the ones which are false. Why is that needed?

And why that simple formular doesn't work with thisRecord or allItems?  : 

Collect(colOrdernumbers;Gallery.AllItems)

 

Best. 

 

Helpful resources

Top Solution Authors
Top Kudoed Authors
Users online (4,110)