Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
The purpose of the flow shown in the screenshot is to assign a newly created DMNTSK to the user that has not closed a task very recently and has nothing assigned. For example, if the flow action #6 returns 3 records, I need to select the oldest one of them. How can I accomplish this?
Note: Action #6 sorts z to a in order to get the most recently closed tasks. I'm trying to capture the Assigned value of the oldest record of action #6 to assign it to the new task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Sort by "Closed" and order a to z. This way you will get the oldest closed record.
You can then reference this record and pick the "assigned to" value using data pills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@sash_machiraju Action 6 could return multiple records, the most recent closed task for each user. For example,
DMNTSK000001, Assigned to Bob
DMNTSK000002, Assigned to Rob
DMNTSK000003, Assigned to Mirna
I need the oldest of those 3. Ordering a to z is not what I'm looking for. Any other suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Sorry for the confusion earlier @Runel
I would approach this from the task side rather than the user side.
Right now, the flow starts by finding all eligible reviewers and then looks up each person's most recent closed task. The challenge is that you end up with one closed task per reviewer and then need additional logic to determine which of those tasks is actually the oldest.
Instead, we could start with the closed tasks themselves, sort them by Closed At (oldest first), and then check whether the assignee is still eligible (correct title, not OOO, and does not already have an active task).
This simplifies the logic because we're working from a single ordered list of tasks rather than collecting a task for every reviewer and comparing the results afterward. The first task whose assignee meets all eligibility criteria would be selected.
For example.
- Lookup Records for closed review tasks.
- Order by Closed At ascending.
- For Each Task
- Check whether the assignee:
- Has the correct title
- Is not OOO
- Does not have an active CSA review task
- Check whether the assignee:
- As soon as you find an eligible assignee:
- Store that user in a flow variable.
- Exit the loop (or skip further processing).
- Assign the new review to that user.
