I’m trying to limit the data returned for a view of our tasks, but I’m running into an issue.
Here’s how it currently looks
The Recent Updates button works, but it shows a long list —I’d like to limit it to the 10 most recently updated tasks.
I’ve tried different approaches using Slice(), but nothing has worked quite right, and I have a feeling I might be overcomplicating this.
How would you go about limiting the results?
Here’s the current code for the button:
RunActions(
ResetControlValue([View Tasks Due Date]),
ResetControlValue([View Tasks Assigned]),
ResetControlValue([View of Tasks Status]),
SetControlValue(
[View Tasks Modified on], List(Today() - 7, Today())
)
)
Dear @Edan_Ben-Atar ,
This post shows you how to limit the result according your needs.
Hello. It works for me but there’s something extra I wanted to do.
I have a task table with some columns, but the ones that matter for this are Urgency(returns a float falue) and Status(Returns a pre-defined string such as ‘to-do, waiting, done, cancelled…’).
Very well, I want to apply the slice in Urgency and sort it out by the highest value. Here’s the fórmula:
thisRow.In(thisTable.Sort(false(),thisTable.Urgency).Slice(1,3))
It works fine, but it brings all the tasks with all Statuses and …
2 Likes
Thanks! I’ve been reviewing that thread but haven’t had any luck applying it to my case.
Here’s my latest attempt:
ResetControlValue([View Tasks Due Date]),
ResetControlValue([View Tasks Assigned]),
ResetControlValue([View of Tasks Status]),
// Set the date range filter to the last 7 days
SetControlValue(
[View Tasks Modified on], Slice(List(Today() - 7, Today()),1,10)
)
)
Dear @Edan_Ben-Atar ,
Please mind sharing a dummy document,
much better chances to receive adequate support.
1 Like
Dear @Edan_Ben-Atar ,
Thank you sharing the doc.
You should add one more filter to the table as in the screenshot below:
and this is the formula: thisRow.In(thisTable.Sort(true, thisTable.[Due date]).Slice(0, 10))
For a detailed explanation how it works, I recommend you this post of Shishir:
Here’s an example with a walkthrough of the key steps:
I will not be able to explain it better then him
3 Likes
Hi,
I made an example a long time ago:
You can use same principle
3 Likes
system
Closed
March 7, 2025, 12:40pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.