cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Responsive Resident
Responsive Resident

Stuck on "Getting your data..." after clicking on item in gallery

When a user clicks on an item in the gallery, the initial form screen gets stuck on, "Getting your data ...". Oddly this goes away if you click back to the gallery and then click on any item in the gallery again. It only happens on the first try.

 

Based on other posters I've tried:

 

1) Reduced the number of lookups back to sql server in order to reduce the amount of data its pulling

2) Switched all of the collections to load concurrently() initially in the app

Concurrent(
 Collect(EmployeeData, '[dbo].[App_PAFNewProj_Emp_vps]'),
 Collect(Loc, '[dbo].[App_PAFNewProj_Loc_vps]'),
 Collect(Cust, '[dbo].[App_PAFNewProj_Cust_vps]')
 ) 

 

3) Added, ResetForm(Form1) into the OnSelect in the Gallery

None of the above has worked.

Any other thoughts? Is there anything I could provide that would be helpful?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @TesDA 

I'm not certain as to why that is except that it is not typical to put a Patch() in the OnSelect property of a gallery that uses an edit form.  I think we are making progress.  As a test, let's simplify! Remove the Patch() and add the fields that you intended to patch to your edit form and make the default properties of the controls in those cards to be what you intended with your patch.  Then, make the following changes.  In the OnSelect of the arrow in the gallery just have

 

EditForm(Form1);Navigate(scrForm1,ScreenTransition.None)

 

 On the Item property of Form1

 

Lookup('[dbo].[App_PAFNewProj_Main]',ID=Gallery1.Selected.ID)

 

 See if that helps.  

View solution in original post

5 REPLIES 5
Super User II
Super User II

Hi @TesDA 

Please show the  Items and OnSelect properties of the gallery and the Datasource and Item property of the target form.

Responsive Resident
Responsive Resident

@Drrickryp Sure!

 

Gallery_Main

Items: Filter('[dbo].[App_PAFNewProj_Main]', (TextInput1.Text in Agency || TextInput1.Text in ProjName || TextInput1.Text in EntryUserName) And (Dropdown1.SelectedText.Value in PAFProjEntryStatus))

OnSelect: ResetForm(Form1)

NextArrow OnSelect: Patch('[dbo].[App_PAFNewProj_Main]', ThisItem, {EditedBy: User().FullName, EditedWhen: Now()}); Set(varFormMode,"edit"); Set(varRecord,ThisItem); Navigate(scrForm1,ScreenTransition.None); 

 

Screen: scrForm1

Form: Form1

DataSource: '[dbo].[App_PAFNewProj_Main]'

Item: If(varFormMode = "edit", Gallery_Main.Selected, varRecord)

Hi @TesDA 

I had a few ideas about your formulae.

OnSelect:
Patch('[dbo].[App_PAFNewProj_Main]', ThisItem, {EditedBy: User().FullName, EditedWhen: Now()});
/*Why Patch at this point when you can have these fields set by defaults in the Edit form?*/
EditForm(Form1); // This is the preferrred way to set the form mode
Set(varRecord,ThisItem); 
Navigate(scrForm1,ScreenTransition.None)

Screen: scrForm1
Form: Form1
DataSource: '[dbo].[App_PAFNewProj_Main]'
Item: Lookup('[dbo].[App_PAFNewProj_Main]',ID=varRecord.ID)
Responsive Resident
Responsive Resident

@Drrickryp I made the edits you suggested and Getting your data no longer appears, however the first screen/ form isn't defaulting back to the values based on the item clicked in the gallery. If I go back to the gallery and click on the same item or even something different - all of the default values populate correctly. It only happens on the initial click in the gallery after loading the app.

Hi @TesDA 

I'm not certain as to why that is except that it is not typical to put a Patch() in the OnSelect property of a gallery that uses an edit form.  I think we are making progress.  As a test, let's simplify! Remove the Patch() and add the fields that you intended to patch to your edit form and make the default properties of the controls in those cards to be what you intended with your patch.  Then, make the following changes.  In the OnSelect of the arrow in the gallery just have

 

EditForm(Form1);Navigate(scrForm1,ScreenTransition.None)

 

 On the Item property of Form1

 

Lookup('[dbo].[App_PAFNewProj_Main]',ID=Gallery1.Selected.ID)

 

 See if that helps.  

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (39,396)