I have an App with a Gallery and a Form Side by Side - on the same screen. Like this:
Currently, when I select a record, I have the form display the selected record. The users edit the record and it creates a COPY in the SP list. So they do this for every record and hit 'Submit' every time. Typically, the gallery will have about 10 records. I have a flag in the Gallery that indicates when a record has been updated - based on a Collection linked to the 'Submit' button on the form.
Rather than editing and submitting one record at a time, is there a way that the users can edit multiple records directly in the Gallery (or somewhere else) and hit submit once? I know this has something to do with a Collection, but I am not sure how to work with my requirement that the edited record does not overwrite the original, it has to create a new record in the list.
Solved! Go to Solution.
Hi@Canadiansal,
Based on the issue that you mentioned, do you want to edit multiple records at a time and save as new records?
Could you please share a bit more about the scenario?
I have a test on my side, please take a try as below.
In my scenario, I have a SP list to fill in the Gallery.
1).Add a blank Gallery and insert TextInput controls as you want.
2).Insert an edit icon and set the OnSelect as below:
Set(varEditMode,ThisItem.ID)
3).Set DisplayMode property of each TextInput as below:
If(varEditMode=ThisItem.ID,Edit,View)
4).Insert Checkbox and set OnCheck as below:
Collect(ColGallery,{Title:TextInput3.Text,Weather:TextInput4.Text,Activity:TextInput6.Text})
5).Add a Save button and set OnSelect as below:
ForAll(ColGallery,Patch(EditGallery,Defaults(EditGallery),{Title:Title,Weather:Weather,Activity:Activity}));Clear(ColGallery)
Every time after you click the edit icon, please remember to check the checkbox, it will collect all the items you want to save as new records into a collection. And then, you click the button to save the collection to the data source.
Regards,
Qi
Follow this tutorial from Reza Dorrani
------------
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi@Canadiansal,
Based on the issue that you mentioned, do you want to edit multiple records at a time and save as new records?
Could you please share a bit more about the scenario?
I have a test on my side, please take a try as below.
In my scenario, I have a SP list to fill in the Gallery.
1).Add a blank Gallery and insert TextInput controls as you want.
2).Insert an edit icon and set the OnSelect as below:
Set(varEditMode,ThisItem.ID)
3).Set DisplayMode property of each TextInput as below:
If(varEditMode=ThisItem.ID,Edit,View)
4).Insert Checkbox and set OnCheck as below:
Collect(ColGallery,{Title:TextInput3.Text,Weather:TextInput4.Text,Activity:TextInput6.Text})
5).Add a Save button and set OnSelect as below:
ForAll(ColGallery,Patch(EditGallery,Defaults(EditGallery),{Title:Title,Weather:Weather,Activity:Activity}));Clear(ColGallery)
Every time after you click the edit icon, please remember to check the checkbox, it will collect all the items you want to save as new records into a collection. And then, you click the button to save the collection to the data source.
Regards,
Qi
Thank you - this looks like it might work. I am not sure how to populate the Blank Gallery. What values do I need to set for the TextBox?
Hi@Canadiansal,
You just need to populate the TextInput with the SP list.
Set the first TextInput Default property:
ThisItem.Column1
Repeat the above formula for the left TextInput to display other column values.
Regards,
Qi
Do I need to set any other property in the Galery. Still getting erors.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
204 | |
71 | |
51 | |
49 | |
20 |
User | Count |
---|---|
260 | |
121 | |
85 | |
76 | |
72 |