cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Automatically refresh after relate() relationship

Hi,

I am experimenting with Project Oakdale and advanced relationships using the relate() function and an edit form.

issue relations cds.PNG

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)?

relationship issue cds 1.PNG

Has anyone a solution to automatically refresh after using an edit form and the relate() function?

Thanks in advance.

 

Kind regards, Wouter

2 REPLIES 2
chsanche
Community Support
Community Support

Hi @Anonymous 

 

Is the data on the first entity refreshing fine? Want to make sure the relate() function is actually working fine.

 

Best Regards,

If this post helps you give a :thumbs_up: and if it solved your issue consider Accept it as the solution
Anonymous
Not applicable

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:

Relate(Gallery1.Selected.Meetings, formMeeting.LastSubmit);Refresh(Inspections)

Above formula was the formula of my first post.

In the meantime, I was able to refresh the data by changing the Refresh function:

Relate(Gallery1.Selected.Meetings, formMeeting.LastSubmit);Refresh(Institutions)

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:

WouterF_0-1605127798433.png

Thanks in advance

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,064)