cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ing_Jesus_Lopez
Frequent Visitor

checkbox and datatable

Hello, I have a data table with two columns called tech skill, id and a gallery with the tech skill checkbox, I want to insert the value of each checkbox checked in my database and show the selected skills in my datatable

4 REPLIES 4
Silvester
Super User
Super User

How does your database look like? Do you have a column for each one of those skills in your DB?
You need to load all the checkbox elements inside a collection that loads anytime the app is started. So you set this on the OnStart 

ClearCollect(ColName,[".Net",....,"Java"])

Then you have another collection for all the elements that are being checked against. So on the checkbox Oncheck property, Set this 

Collect(Checked,ThisItem.Value)

Then on your save button, add this

ForAll(Checked,Patch(DataSource,Defaults(DataSource),{Skills: ThisItem.Value}))

You could also twerk it to make it suit your process.

If you find this post interesting, give it a like and accept it as a solution to help others find it

Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the thread and so other members of the community can find it easily.

Hello Silvester, my database is a relation database, in this case, the skill values is a catalog, this table have a 3 columns, idskill, cve and description, in my gallery show the description but i should insert in another table only the skill id.

 

Best regards

Silvester
Super User
Super User

Alright, @Ing_Jesus_Lopez ,
Assuming you are loading the skills checkboxes from the catalog, do this.

You need to have another collection for all the elements that are being selected. So on the checkbox's Oncheck property, Set this 

Collect(Checked,ThisItem.Value)

Then on your save button, add this to the OnSelect Property

ForAll(Checked,Patch(DataSource,Defaults(DataSource),{Skills: ThisItem.Value}));Clear(Checked)

 

Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the thread and so other members of the community can find it easily.
Ing_Jesus_Lopez
Frequent Visitor

Hello, i have a new issue when insert the information, the issue is because repeat autoincrement column in my table when apply the patch function. How to insert increment values for each checked checkbox.

 

Regards

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (4,007)