Hello!
Right now in my gallery I sort on an text column where my colleges insert todays date and time. My gallery in sorted descending on this column.
The problem is when the app get more than 500 objects is about for example 5 days, that object with the status "Transfer to future date" will dissapear. I dont want more than 500 objects at once in the app because of performance issues if its above that threeshold.
So to the question: Is there anyway to sort on the "Status" in secondhand somehow? SortByColumns or something? I want to object with the status "Transfer to future date" to always be visible in my app no mather what.
This is the sortfunction I use now:
Filter(
Sort(
Logg;
'Case received';
Descending
)
Appreciate the help, thanks!
Hi @Anonymous :
No error indicates that the logic of the formula is correct, and we are close to success.I suggest you try to execute this command in stages to ensure that the formula can be delegated.For example:
Set(ManuellUppdateringSpinner;true);;
ClearCollect(
CollectLogg;
Sort(
Filter(
'Logg';
Status.Value = "Transfer to future date"
);
'Case Received';
Descending
);
);;
Collect(
CollectLogg;
Sort(
Filter(
'Logg';
Status.Value <> "Transfer to future date"
);
'Case Received';
Descending
);
);;
Set(ManuellUppdateringSpinner;false))
If this formula fails to get a result, I suggest you check whether
Filter('Logg';Status.Value = "Transfer to future date");
can get a result.
Best Regards,
Bof
Hello!
I tried:
Filter('Logg';Status.Value = "Transfer to future date")
in the gallery without clearcollect and there is no delegation warnings, works just fine.
Then I tried your code, and I get errors on the "););;" part and delegation warning on "Status.Value <> "Transfer to future date"":
Set(ManuellUppdateringSpinner;true);;
ClearCollect(
CollectLogg;
Sort(
Filter(
'Logg';
Status.Value = "Transfer to future date"
);
'Case Received';
Descending
);
);;
Collect(
CollectLogg;
Sort(
Filter(
'Logg';
Status.Value <> "Transfer to future date"
);
'Case Received';
Descending
);
);;
Set(ManuellUppdateringSpinner;false))
Hi @Anonymous :
Sorry ,I made a mistake.You shour remove the ";":
Set(ManuellUppdateringSpinner;true);;
ClearCollect(
CollectLogg;
Sort(
Filter(
'Logg';
Status.Value = "Transfer to future date"
);
'Case Received';
Descending
);
);;
Collect(
CollectLogg;
Sort(
Filter(
'Logg';
Status.Value <> "Transfer to future date"
);
'Case Received';
Descending
)
);;
Set(ManuellUppdateringSpinner;false))
In theory, <> supports delegation for the complex field in the SharePoint List. I'm not sure what caused the warning(Maybe because Collect is not delegable), but even if it can't be delegated, this formula should already meet your requirements.
Best Regards,
Bof
@v-bofeng-msft I think this almost worked, I think we are close.
It still gives delegation warning on the <>part. I had to remove another ";" to make it work. My code looks like this:
Set(ManuellUppdateringSpinner;true);;
ClearCollect(
CollectLogg;
Sort(
Filter(
'Logg';
Status.Value = "Transfer to future date"
);
'Case Received';
Descending
)
);;
Collect(
CollectLogg;
Sort(
Filter(
'Logg';
Status.Value <> "Transfer to future date"
);
'Case Received';
Descending
)
);;
Set(ManuellUppdateringSpinner;false)
When I click the refresh button it shows me the older "Transfer to future dates" objects for a slight second and then it dissapears.
User | Count |
---|---|
253 | |
106 | |
94 | |
50 | |
39 |