I am making a repeating table form. When an item is entered, it creates and entry in the master list and multiple entrying in the detail list.
I would like to make another screen that shows a gallery ( MasterGallery) with two edit forms, that displays the editable items when MasterID = ID
I was able to display Gallery to Form1 using MasterGallery.Selected, but I can't figure out a way to connect Form1 to Form2.
Solved! Go to Solution.
Create another form right below that one (Copy/Paste) and set the DataSource (or Items honestly) to be the same function as before except make it Last(...) vs. First(...). NOTE: This of course will only handle a 2-item list at the most.
BTW, you'll still need to do a SubmitForm(...) on each of your forms if changes are made. I'd suggest a Disabled by default "Save" button that becomes active if any field's value is changed on any Form. You can just submit all forms in that scenario (e.g. SubmitForm(Form1);SubmitForm(Form2)...)
Yeah, you'd have to do some fancier sorting/popping of the list in order to do more than 2. It can work that way, you just start needing to juggle the Collection variable a bit more. The Gallery is the simplest way to handle an array of things that come up in that scenario (scroll bars, fit to size, etc.). However, you could still do it using the method we just tried, we'd just need to get funky w/ our Filter for each list (e.g. Filter main list, grab first item, add first item to Form1 and second list, filter main list + Not in 2nd list, add first item to Form2 and second list, later/rinse/repeat until main list is empty).
Hi @crjohnson82 ,
Do you want to display multiple Items from your second table within the Form2 (Edit form)?
If you want to display multiple Items from your second table within the Form2 (Edit form), I afraid that there is no way to achieve your needs in PowerApps currently.
The Edit form control in PowerApps could only be used to display single one record within your data source, it could not be used to display multiple items.
As an alternative solution, you could consider use a Gallery control to achieve your needs instead of the Form2. On your side, you could add a another Gallery within your screen, and configure it as Editable table.
I have made a test on my side, please take a try with the following workaround:
Add another Gallery within your app (instead of the Form2), then configure it as a Editable table. The screenshot as below:
Set the Items property of the another Gallery to following:
Filter(secondDataTable, ID = Gallery.Selected.ID)
Add appropriate controls (e.g. Text Input controls, DatePicker, Toggle, ...) within above Gallery to list the column values in your second Data Table.
Add a "Check" icon within your Gallery, set the OnSelect property to following:
Add a "Remove" icon within your Gallery, set the OnSelect property to following:
The sample app, please check the attached .msapp file.
More details about configuring a Gallery as a Editable table, please check the following video:
Please consider take a try with above solution, then check if the issue is solved.
@v-xida-msft.. Thanks for that.
I had to put ThisItem.Selected in the patch formula for it to work. But NOW when I save the changes made to the first form it creates duplicate entries in the secondDataTable (Gallery). First form saves the changes w/o any duplicates.
I have a save button on the form b/c I have to make edits to the First Form also.
On the save button I have , OnSelect = SubmitForm(EditForm).
How do I prevent this?
HI @crjohnson82 ,
Do you mean that it would create repeated reocrds within your secondDataTable when you save the changes within your first form?
Do you add other formulas within your app to create records in your secondDataTable when record is created/modifed in your MasterList data source?
Based on the issue that you mentioned, I suppose that you add other formulas within your app to create records in your secondDataTable or fire a flow (MS Flow) to create records in your secondDataTable when record is created/modifed in your MasterList data source.
Please check if you have added other formulas within your app to create records in your secondDataTable or fire a flow (MS Flow) to create records in your secondDataTable when record is created/modifed in your MasterList data source.
As an fixed solution, please consider re-create a new app based on your data source, then try above solution I provided, then check if the issue is solved.
Note: Please make sure that you do not design a flow (Microsoft Flow) to create records in your secondDataTable when record is created/modifed in your MasterList data source.
@v-xida-msftThanks for the help. I really appeciate it.
After I got the second table working correctly, I added a delete icon, and used the below formula on OnSelect.
Remove('Requests',MasterGallery.Selected);RemoveIf(Details', TextInput5 = ID_DataCard2)
- TextInput5 is a format is a number (copied to the list, when the item is created)
- ID_DataCard2 (the number that was automatically created.)
It's giving me the error: "Incompatible type: We can't evaluate you formula because the values being compared in the formula aren't the same type."
I am trying to select an item in the MasterGallery, and when I click delete, delete items in the EditForm and DetailGallery, if the TextInput ID (DetailGallery) = ID_DataCard2 (EditForm).
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!