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

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
Super User
Super User

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
Resident Rockstar
Resident Rockstar

@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
Resident Rockstar
Resident Rockstar

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
Super User
Super User

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

@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.

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

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.

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
Resident Rockstar
Resident Rockstar

@pamboys09 

Like this, if that makes sense.

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

View solution in original post

@EricLott @WarrenBelz  Thank you !

 

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,676)