Hello,
to improve the performance of my sharepoint datasource I want to cache a table. Its just a simple table with text quotes and a index number. This table won't change so its okay to cache them.
Table name is QuotesTable. It has Index from 0 to 37 and each row has a different quote text.
I use a button to change the text quotes randomly in a lable on OnSelect of the button:
Navigate(Screen2);;Set(vRandom;RandBetween(0;37))
The label text property has this:
LookUp(Shuffle(QuotesTable); Index= vRandom; Quote)
So every time I click on the button, screen2 appears and the text in that label is changed randomly.
To increase the speed of loading the app I want it to cache the whole quoteTable. So I write in the OnStart
of the App:
Set(vQuotes;ClearCollect(CachedQuotes;QuotesTable))
In the label I change the property in Text to:
LookUp(Shuffle(vQuotes); Index= vRandom; Quote)
Now my label is always empty and I dont't know why. The ClearCollect table shows me data, but the label isn't showing any text when clicking on the button to switch the quotes. Seemingly it cannot "pull" the quotes from the variable. Is it maybe not possible to put the collect table as a global variable? Another appraoch was to put the whole ClearCollect formula into the Shuffle parenthesis, but I get a error doing this.
Hope someone knows a solution to this.
Thank you very much in advance.
Best.