I probably am just not understaning how delegation works, so please let me know! I have an app using a CDS for the data, which should be delegable by my understanding. The CDS is a large list of products for a chain fo retail convenient stores. I have a home page where you choose the store# (StoreNum) from a dropdown called Dropdown1. You then click a button with the OnSelect code of:
Navigate(BrowseScreen1,ScreenTransition.Fade,{SelectedStore: Dropdown1.Selected.Value})On BrowseScreen1 BrowseGallery1 has the Items code of:
Sort(Filter(If(IsBlank(TextSearchBox1.Text), Products, Filter(Products, TextSearchBox1.Text in Text(ItemNameWeight))), SelectedStore = StoreNum), ItemNameWeight, Ascending)
So basically the user chooses a StoreNum on the first page, and then when they search the gallery, all they see are results from that store. It only works for the first 500 records of the CDS though, which happens to be store# 218. If I choose store 218 and then search "Coke", I get 18 records in the gallery, which means that it is only returning the 18 "Coke" products that appear in the first 500 records. (there should be 24 total) If I choose a different StoreNum, then the gallery is blank, since there are no other stores in the first 500 records.
I believe that IF statements are not delegable, so I tried removing the If statement fom the above code like this:
Sort(Filter(Products, TextSearchBox1.Text in Text(ItemNameWeight)), ItemNameWeight, Ascending)
That still only searched the 500 items. I also tried removing the StoreNum restriction, so that the gallery should search all records, but still only 500 items.
What am I doing wrong? Is there a trick to get the app to work with delegation? Or is there something else that I'm doing that is not delegable?