Limiting the returned data with RunActions

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 :point_down:

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.

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

Here you go: https://coda.io/d/_drzaWtfeLxy/Tasks_suqjE9cB

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:

I will not be able to explain it better then him

3 Likes

Hi,
I made an example a long time ago: :slight_smile:

You can use same principle

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.