Hi, I'm very new to PowerApps and have taken a head on approach to creating an app for my company, so my decisions may not be optimal to the process of a seasoned PowerApps creator. The application communicates via an implicitly shared connection to an SQL server hosted by Azure. As far as form editing goes, I have set up screens for each type of entry type necessary, since functionality varies for each. The edit screen is reached via a button on each gallery field.
This button starts a timer that OnTimerEnd() will Navigate to the edit form. Prior to the timer's implementation, the Navigation was solely conducted via the button pointed out in the image above. The timer was implemented because when an item was selected via the gallery; You were taken to the earliest created item in that gallery. This only happened when you were moving from ticket to ticket very rapidly, thus the implementation of the timer delay. But now I have run into the problem of occasionally having that same issue occur(very rare), and the very reliable issue of the first ticket you try to navigate to always returning an edit screen with blank values.
I must also say that I am not using the included form objects (edit form display form), but am assigning various label's defaults to the gallery's selected item value for that field.
Initially, I believed that I was refreshing the connection to SQL Server too often; however, I am starting to think that it is an issue with how I am displaying the data. Any ideas on how to resolve the issue I am seeing when I load the edit screen for the first time, or why the first item keeps being displayed if navigating between items too quickly are both welcome.
You are relying on the Selected property of the Gallery. PowerApps gets data as needed. So, your Gallery might list certain parts, but when you navigate to the edit screen, then it "demands" the record and must get it.
First, get rid of the timer - you don't need it.
Get rid of your Refreshes - they will slow your app down.
Next, instead of relying on the Selected property of the Gallery, change your OnSelect for the Icon to:
Set(glbCurrentRecord, LookUp(yourDataSource, ID=ThisItem.ID)); Navigate(yourEditScreen)
Replace the ID part with whatever is the primary key column from your SQL datasource.
When you Set a variable like that, PowerApps will wait until the full record is retrieved.
Finally, set the Item property of your Form to : glbCurrentRecord
I hope this is helpful for you.
I knew that the refreshes would slow down the app, and I think that is definitely a source, but it was requested that multiple users will be using the app and if 2 users are on the same ticket they would want to see live changes done. This was only achievable via refreshes. Is there any alternative to reaching this level of functionality?
Yes - realize that PowerApps is not real time!! There are certain tricks that can be done to avoid the refreshes and still get changes, but they are not really real-time either.
Best thing to do is to work out another way to augment the data for the ticket with another list, or avoid having 2 users edit at the same time. If that is a hard and firm requirement, then PowerApps may not be the best choice. Yes, it can be "wedged" into simulating it, but it comes at the cost of performance and occasional data errors and lost data - which become more of an issue than the first.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.