So I have a screen that has multiple labels that get populated with values from the same SQL table. I'm currently filling each labels text with LookUp(table-name, filterValue = fieldName).result (generalized).
I’m wondering if it would be faster to just set that lookup as the var and use that over again. Set(varRecord, LookUp(table-name, filterValue = fieldName)) and then set the text as varRecord.Result (as well as all the other ones)
Basically, is that var holding that record in memory or is it doing it do the lookup over and over anyways?
Thanks for the feedback!
Solved! Go to Solution.
Hi @Jsunnb ,
Yes - I use Record Variables all the time, so
Set(
varRecord,
LookUp(
table-name,
filterValue = fieldName
)
)
will capture the entire record, then
varRecord.YourFieldName
will show each field in the record.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi @Jsunnb ,
Yes - I use Record Variables all the time, so
Set(
varRecord,
LookUp(
table-name,
filterValue = fieldName
)
)
will capture the entire record, then
varRecord.YourFieldName
will show each field in the record.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
@Jsunnb ,
Performance-wise, it is always good if you reduce the queries to DB.
You can query SQL, set a collection on App Start, and use the Lookup/Filter functions to query against the collection instead of SQL.
@SudeepGhatakNZ I haven't tried out collections. My concern is most of what I'm doing is relying on the delegation feature putting the work on the SQL server, and I was concerned putting it into a collection will force me into the 500 lines restriction.
User | Count |
---|---|
260 | |
110 | |
92 | |
56 | |
41 |