I am experimenting with Project Oakdale and advanced relationships using the relate() function and an edit form.
I have a first gallery, Gallery1, that just displays items of an entity "Inspection"
Secondly, a gallery, Gallery2 that shows Gallery1.Selected.Meetings.
Because new meetings need to be created, there is a "Edit form" for meetings on the same screen.
This EditForm has a OnSuccess parameter "Relate(Gallery1.Selected.Meetings, formMeeting.LastSubmit)"
So after saving the form, the relationship between Inspection and Meeting is set, this works successfully.
However, the data is not refreshed automatically, so the newly created meeting is not visible.
If you reselect something in the first gallery, the app crashes. The app does not crash when you first click a refresh button that refreshes the entity. Also when you refresh the whole app, the data just shows as it should.
Because I don't want the users to manually refresh on every one-to-many or many-to-many relationship that is created using the relate() function and I don't want the app to crash, I am searching for a solution.
I already tried to put a refresh button after the relate function "Relate(Gallery1.Selected.Meetings, formMeeting.LastSubmit);Refresh(Inspections)" but this doesn't help.
In the documentation, they say something about manually refreshing, so maybe it's desired behavior and there is just no workaround (yet)?
Has anyone a solution to automatically refresh after using an edit form and the relate() function?
Thanks in advance.
Kind regards, Wouter
Is the data on the first entity refreshing fine? Want to make sure the relate() function is actually working fine.
Hi @chsanche ,
Using only the relate() function, the (first entity) data is not refreshing for me. My model is as follows:
Institution => Inspection => Meeting
Many to many relation between Institution and Inspection.
One to many relation between Inspection and Meeting.
I relate in the OnSuccess property of the edit form:
Above formula was the formula of my first post.
In the meantime, I was able to refresh the data by changing the Refresh function:
So I replaced Refresh(Inspections) with Refresh(Institutions).
Institutions is the "lowest" entity in my model. All the other entities are linked to this.
After clicking the save button and the OnSuccess running this formula, the data is refreshed.
But out of the box, only with the relate() function, no data is refreshed.
Also, my app crashes a lot both in the Power Apps editor or also when just running the app.
When it crashed, the app needs to be reloaded completely.
For example sometimes it crashed when you click on the combobox for a second time, because the galleries are populated based on the selection in that combobox. In the screenshot see the text in red where I try to clarify it:
Thanks in advance