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

Adding multiple records from Gallery of check boxes

Hi.

 

I did have a simalar post which was accidently solved which I couldn't turn back to unsolved... anyway my problem is this.

I have to collect data on training completed i have a few tables with the type of training and the staff details and then a table with the training that they actually do.  I have created in powerapps a gallery showing the training that has to be completed and a checkbox by each one.  What I want is for people to be able to check each box depending on whether they have completed said trainnig and then a submit button to be pressed and at that point for every check box that is checked the corrosponding training to be added to the table.

1.png

This is an example so if I check dodge and dip and then clicked on the submit button i would want 2 records created and both showing who and when did it.  

Hope that makes sense and someone can help.

 

Thank you

8 REPLIES 8
Community Support Team
Community Support Team

Re: Adding multiple records from Gallery of check boxes

Hi @paranap,

Can you share a bit more about your issue?

Which data source do you want to submit to ?

 

I assume that your data source is sharepoint list.

I made a test.

17.PNG

18.PNG

 

Set Onselect property of the submit button to :

ForAll(ClearCollect(collection1,Filter(Gallery1.AllItems,Checkbox1.Value=true)),Patch(test7,Defaults(test7),{Title:Title,creator:User().FullName,'created date time':Now()}))

Regards,

Eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
paranap
Level: Powered On

Re: Adding multiple records from Gallery of check boxes

Hi.  Thanks for your reply.

 

The data source I am using is an Excel spread sheet.  It has 3 tables to allow for data integrety one with Staff details with a unique staff ID, one for the compentancies with a unique compentancy ID and then a training record which should record the staff id compentancy ID for each checked box.

I have tried to encorporerate your code into my app but is coming up with an error says the check box isn't their when it is.  Any thoughts?

 

Neil

paranap
Level: Powered On

Re: Adding multiple records from Gallery of check boxes

Hi again.

 

The other thing I'm struggling with (one of many things) is the unique staff ID number linked to the user ID and then the Compentancy ID number linked to each compentancy/check box as these are this things i need to up load to the spread sheet.

 

Neil

mpleszko
Level: Powered On

Re: Adding multiple records from Gallery of check boxes

Hi Neil,

to be able to help you I tjink you should share some screens and formulas you are using.

Regards,

Marcin

 

paranap
Level: Powered On

Re: Adding multiple records from Gallery of check boxes

Hi.

 

I did attach a formula in the second to last post which was simalar to the suggestion made but is coming up with an error saying checkbox3 isn't there when it is.  As for looking up the staff ID and training ID to match the user and what has been selected I'm not really sure where to start.

 

Neil

Community Support Team
Community Support Team

Re: Adding multiple records from Gallery of check boxes

Hi @paranap ,

Could you show me the screenshot about your data source?

Is Items property of the gallery set to training record table?

 

Please try the following methods :

17.PNG

 

Set Onselect property of the button to :

ForAll(RenameColumns(Filter(Gallery1.AllItems,Checkbox1.Value=true),"ID","ID1"),Patch(test3,LookUp(test3,ID=ID1),{creator:User().FullName,time:Now()}))

 

 

Regards,

Eason

Community Support Team _ Eason YU
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
paranap
Level: Powered On

Re: Adding multiple records from Gallery of check boxes

Hi.  Thank you again for your reply.

Please find attached my data sources.  There are three.  The top on is the compantancy table the next one is the staff table and the last one is the one i want to populate is the training table. 

The Gallery on the App shows the compantancies so when you check the boxes against each compantancy and click the button I want the training table to show each compantancy that has been checked along with the name of who has done it and a date.

 

Neil

mpleszko
Level: Powered On

Re: Adding multiple records from Gallery of check boxes

I think you could try to fulfill the "at-the-end" expected table (trainings) with sample records. Then I would try to create an app based on data - you should get 3-screen app, automatically generated.

I think there is no support to related tables yet in PowerApps - correct me if I am wrong.

 

Formulas to use:

> Collect(TrainingsBeingReported;ThisItem) - to collect info about attended training 

> ForAll(TrainingsBeingReported;Patch(Trainings;{CompetencyName:Competency;TrainingType:Type;Autor:(User().FullName); Date:Now() })); **/ {SourceField:CollectionField}

> Clear(ThisCollection)

 

 

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 171 members 4,961 guests
Please welcome our newest community members: