Errors with list repeating

Hi guys,

I believe there is some issue with behaviour/refreshing of the lists.

I have a data object containing sales orders and I wanted to display them as a List, filtered with Start and End dates.

My approach was to get a local data variable containing all orders and repeat a list item with selection using the following formula:

SELECT(data.LocalStoreOrders, item.createdAt >= pageVars.dateRangeStart && item.createdAt <= pageVars.dateRangeEnd)

This was not working. The dateRangeStart was working fine but the End of the Range was not working or was generating strange results (dates outside of the range, items on the list would change the date).

The issue is caused by the top of the range as even simpler version of this was not working:
SELECT(data.LocalStoreOrders, item.createdAt <= pageVars.dateRangeEnd)

I think this might be some issue with rendering of the list as the pageVars.dateRangeEnd variable was changing correctly.

What solved the problem was removing formula from Repeat With:

and adding the filter while setting the Data variable passed to the list.

I was afraid that triggering multiple times Get record collection would have worse impact on performance vs just dynamically changing filters on a list , but it seems to work.

BTW I have also noticed that using DATETIME_IS_SAME_OR_AFTER(date1, date2) formula was reducing performance vs just simple >= comparison.

That’s an unfortunate known issue:

  1. Have formula that uses e.g. SORT or SELECT with multiple dependencies (e.g. pageVars.dateFrom and pageVars.dateTo
  2. Use said formula as source for repeat
  3. Change one of the variables so that the formula re-evaluates to a new set of objects

List updates accordingly

List bugs out, with repeated items showing wrong data

This is fixed by exactly what you did – resetting the variable reloads the whole list and shows items correctly.

This will be fixed with the upcoming 2.x version of the client runtime, which we hope to get to beta in a week or two.

1 Like