Hi,
I want to fill a Datatable in a loop by pressing a Button.
For example by pressing the Button the existing Datatable will be written as like :
SerialNr. PersNr.
1 2345
2 2345
3 2345
4 2345
5 2345
6 2345
7 2345
8 2345
9 2345
Does somebody has a Idea how to do it ?
Regards
Vinzenz
Hi @vloecken
If you're using model-driven apps, then this is out of the box (OOB). All you need to do is define your table and form and use the OOB "New" button as the button to create new rows.
To create a table: https://docs.microsoft.com/powerapps/maker/data-platform/create-edit-entities-portal
To set up auto number (SerialNr. column): https://docs.microsoft.com/powerapps/maker/data-platform/autonumber-fields#create-an-autonumber-colu...
To create a form: https://docs.microsoft.com/powerapps/maker/model-driven-apps/use-main-form-and-components
Hope this helps!
Using a combination of ForAll, Sequence, and Patch to a collection that the table is connected to might do it. You can define how many rows you want in Sequence then in the Patch function SerialNr would be whatever Sequence you're on and PersNr. would be what you have there already.
Code for the 'Generate' button:
Just edited my code there so it doesn't create a blank line like in the screenshot.
User | Count |
---|---|
19 | |
15 | |
14 | |
10 | |
8 |
User | Count |
---|---|
40 | |
30 | |
23 | |
22 | |
16 |