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

Help Collection

I'm new to PowerApps and I can tell this would be really helpful for our organization.

 

When I was building our apps. I got stuck on creating Collection with Criteria. (is there a way to collection without a collect button? all the guides i saw in youtube have a button collect)

 

so Here's my apps look like.

dddd.PNG

Basically my goal is to put into collection the following

ID, Name, Role, Employee ID

Here's a sample collection result before the patch.

IDNameRoleEmployee ID
81Adam AC1122444
81Chris CTM1111111
81Bob BTM1122222
81Dupe DTM2222222
81Qwert QTM2333333
81Pop PTM6666666
81Lil LTM8888888

ID will just be a duplicate, and others depend if  the textbox are filled up.

(hope it makes sense)

*any suggestion to make this better are appreciated. thanks!*

 



 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Level 8

Re: Help Collection

Hi @pamboys09 f I understand you correctly, you want to manually make a collection with the data

ClearCollect(
   colNames,
   (ID:81, Name:"Adam A", Role:"C", EmpID":1122444},
   (ID:81, Name:"Chris C", Role:"TM", EmpID":111111},
   (ID:81, Name:"Bob B", Role:"TM", EmpID":112222}
)
and so on

Is this what you are trying to do? Just put it on the OnSelect of a button.<

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

EricLott
Level 10

Re: Help Collection

@pamboys09 

Like this, if that makes sense.

Screen Shot 2020-02-20 at 5.12.52 PM.png

View solution in original post

8 REPLIES 8
EricLott
Level 10

Re: Help Collection

You can add a Collect() function to any control property that starts with On... such as a button's OnSelect or a text input's OnChange.
WarrenBelz
Level 8

Re: Help Collection

Hi @pamboys09 f I understand you correctly, you want to manually make a collection with the data

ClearCollect(
   colNames,
   (ID:81, Name:"Adam A", Role:"C", EmpID":1122444},
   (ID:81, Name:"Chris C", Role:"TM", EmpID":111111},
   (ID:81, Name:"Bob B", Role:"TM", EmpID":112222}
)
and so on

Is this what you are trying to do? Just put it on the OnSelect of a button.<

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

pamboys09
Level: Powered On

Re: Help Collection

@WarrenBelz 

 

those are just example, i want to collect base on the textbox I have from the top.

but Im having trouble to collect by row and ignore those without any text.

pamboys09
Level: Powered On

Re: Help Collection

Got it, I just need help regarding what to put on my collect code.

EricLott
Level 10

Re: Help Collection

I would suggest just having one row of input boxes, then a "Add" button that clears those inputs and dumps them to a temporary collection that is displayed in a gallery. Then you can use ForAll() to add those to your data source.
WarrenBelz
Level 8

Re: Help Collection

Ok @pamboys09 ,

To add - I have called your controls IDTxt, NameTxt, RoleTxt, EmpIDTxt 

Collect(
   colNames,
   (ID:IDTxt.Text, Name:NameTxt.Text, Role:RoleTxt.Text, EmpID:EmpIDTxt.Text}
)

 This should add to the gallery as you input and press the button.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

EricLott
Level 10

Re: Help Collection

@pamboys09 

Like this, if that makes sense.

Screen Shot 2020-02-20 at 5.12.52 PM.png

View solution in original post

pamboys09
Level: Powered On

Re: Help Collection

@EricLott @WarrenBelz  Thank you !

 

The gallery is more efficient way of doing it. Thanks! i learn something new today.

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

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 (10,363)