web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PowerApps: ForAll loop...
Power Apps
Unanswered

PowerApps: ForAll loop not returning correct results

(0) ShareShare
ReportReport
Posted on by 2

Hi Peeps,

 

I'm blocked on an issue where one field in my ForAll loop is not returning the correct results.

 

The issue: The below formula works correctly for either 1 or 2 user selections, but doesn't output the right title when 3 or more users are selected. Noting that when 3 or more users are selected, the userId & userName fields have the right details, its only the title field that doesn't..?!?!?!?! 

 

The formula:

Clear(colThisItem);
ForAll(AddUsers.SelectedItemsText,
 Collect(colThisItem,
 {ID: CountRows(colThisItem)+1,
 userName:Last(FirstN(AddUsers.SelectedItems, CountRows(colThisItem)+1)).Result,
 userId: Last(FirstN(Distinct(Filter(eng, displayName in AddUsers.SelectedItems || IsBlank(AddUsers.SelectedItems)),userId), CountRows(colThisItem)+1)).Result,
 title:Last(FirstN(Distinct(Filter(eng, displayName in AddUsers.SelectedItems || IsBlank(AddUsers.SelectedItems)),title), CountRows(colThisItem)+1)).Result,
 groupId:Last(FirstN(Distinct(Filter(groups, name in Dropdown_Team.Selected.Result),id), CountRows(colThisItem)+1)).Result,
 groupName:Last(FirstN(Distinct(Filter(groups, name in Dropdown_Team.Selected.Result),name), CountRows(colThisItem)+1)).Result
 })
);

 

 

Any steer on this would be GREATLY appreciated

4_Users.jpg
2_users.jpg
Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard