Thank toy very much for your prompt reply, unfortunatelly now I am getting totally lost. The other guy say this:
Here is the best way to do what you want to do, assuming owners has 500 or fewer records:
- Have an initial screen in the app to welcome the user, with no functionality except a button to proceed
This is so that you can cache any lookup tables, this improves performance tremendously - Set the Disabled property of the button to be:
IsEmpty('[Access].[Owners]')This is so that you give the PowerApp time to connect the data source
Q/ so this mean my two tables will be here?
IsEmpty('[tblMain].[TblProjects]')
- Set the OnSelect property of the button to be:
ClearCollect(CachedOwners, '[Access].[Owners]'); Navigate(MyFirstScreen, None)
This is so that you cache the lookup data, may take a few seconds but it is worth it
ClearCollect(CachedOwners, '[TblAMin].[TblProjects]'); Navigate(MyFirstScreen, None)
What does it mean? CachedOwners?
- Then, anywhere you need to display the owner name, you can look up to the cached data instead of needing to call the server. This is most effective in a gallery, where otherwise the server would be called for every line. For example a text box text property would be set to:
LookUp(CachedOwners, ThisItem.OwnerLookupField, DisplayNameField)
How this apply to mi sample?
I am a heavy user of Access Web Apps and with a few tricks PowerApps can do great things with AWA as a back-end.
Here are a few things you should keep in mind, which are true at the time of writing:
1) It is far more efficient to cache lookup tables locally with a collection
2) If the lookup table has > 500 records you can still cache it by using for example:
ClearCollect(CachedInstruments, Sort('[Access].[Instruments]', ID, Ascending));
UpdateContext({MaxID: Max(CachedInstruments, ID)});
If(CountRows(CachedInstruments)=500,
Collect(CachedInstruments, Filter(Sort('[Access].[Instruments]', ID, Ascending), ID > MaxID))
;
UpdateContext({MaxID: Max(CachedInstruments, ID)});
If(CountRows(CachedInstruments)=1000,
Collect(CachedInstruments, Filter(Sort('[Access].[Instruments]', ID, Ascending), ID > MaxID))
;
UpdateContext({MaxID: Max(CachedInstruments, ID)});
If(CountRows(CachedInstruments)=1500,
Collect(CachedInstruments, Filter(Sort('[Access].[Instruments]', ID, Ascending), ID > MaxID))
)))
Yes my two tables has more than 500 records, so:
CachedInstruments will be my data file, [Access].[Instruments] my two tables? tblmain and tblprojects?
Sorry to be a pain, but I thought that this was easier.
Regards