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

Filter and collect SPList with a custom textinput number

Hi,

I've been stuck on this for days, I'm looking to collect a SPList Product Gallery, with a quantity text box into a collection, and then I patch the order into a different SPList. 

I'm unable to collect quantity box, I've been trying filter and if functions, but I haven't managed to get it right.

 

SPList = ProductsGallery

 

I tried the following syntax

1- 

 

ForAll(OrderGallery.AllItems, If(!IsBlank(OrderQuantity.Text),Collect(OrdersCollection, {Quantity:Value(OrderQuantity.Text)},"")))

 

2-

 

ForAll(ProductsGallery.AllItems, Filter( ProductsGallery, OrderQuantity.Text > 0 ), Collect( OrderCollection, { PLI: PLI.Text, Quantity: OrderQuantity.Text } ) )

 

 

appreciate any tips and help. thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

@radhi-bh 

Always check for syntax from replies on this forum...we free-hand type the formulas and often miss parenthesis or commas.

As was the case here...

Formula should be:

ForAll(
    Filter(ProductsGallery.AllItems, Value(OrderQuantity.Text)>0),
    Collect(OrderQuantity, {PLI: PLI.Text, Quantity: Value(OrderQuantity.Text)})
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

@radhi-bh 

You might consider the following for your formula:

ForAll(
    Filter(ProductsGallery.AllItems, Value(OrderQuantity.Text)>0,
    Collect(OrderQuantity, {PLI: PLI.Text, Quantity: Value(OrderQuantity.Text)})
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Highlighted

Hi @RandyHayes - thanks for the reply.

Unfortunately, this also didn't work.

 

radhi-bh_0-1600898498393.png

 

Highlighted

@radhi-bh 

Always check for syntax from replies on this forum...we free-hand type the formulas and often miss parenthesis or commas.

As was the case here...

Formula should be:

ForAll(
    Filter(ProductsGallery.AllItems, Value(OrderQuantity.Text)>0),
    Collect(OrderQuantity, {PLI: PLI.Text, Quantity: Value(OrderQuantity.Text)})
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted

@RandyHayes  Wow, it was just that 1 missing paranthesis . I'm still very new to this, always aware of how much I still have to learn.

Thanks for helping out.

Highlighted

@radhi-bh 

Great!!  If that worked then please check off on Accept Solution so that others can find these answers quickly.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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