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 :
Does somebody has a Idea how to do it ?
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 set up auto number (SerialNr. column): https://docs.microsoft.com/powerapps/maker/data-platform/autonumber-fields#create-an-autonumber-colu...
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:
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.