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 / ForAll looping through...
Power Apps
Answered

ForAll looping through users to write entries for each user - writing the same name every loop problem

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm a complete novice to Power Apps and the entire Microsoft environment. I do have programming experience however.

I've been working on this canvas app as my first assignment. The idea is to have an app where the IT manager can assign IT equipment to employees. It is working properly, but I want the manager have the option of simply picking multiple users if they bought i.e. new phones for 10 employees, instead of having to do all the step 10 times. 

My code is processing, but it writes the first user to all entries in the loop. I'm used to the terminology as follows:

 

 

for i in users:
 print(users[i])

 

 

But it doesn't seem to work unfortunately. 

How do I assign the name appropriate to the user it is looping over?

 

My code:

 

 

ForAll(DataCardValue10.SelectedItems,
 Patch(
 'IT Assets',
 Defaults('IT Assets'),
 {
 'IT Model': LookUp(
 'IT Models',
 Brand = DataCardValue1.Selected.Result And Model = DataCardValue2.Selected.Model
 ),
 Condition: Dropdown2.Selected.Value,
 Price: Int(DataCardValue4.Text),
 Name: Concatenate(
 DataCardValue1.Selected.Result,
 " ",
 DataCardValue2.Selected.Model
 ),
 User: LookUp(
 Users,
 'Full Name' = DataCardValue10.Selected.'Full Name'
 )
 }
 )
)

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,432 Most Valuable Professional on at

    Hi @Anonymous ,

    Try the below

    ForAll(
     DataCardValue10.SelectedItems As aPatch,
     Patch(
     'IT Assets',
     Defaults('IT Assets'),
     {
     'IT Model': 
     LookUp(
     'IT Models',
     Brand = DataCardValue1.Selected.Result And 
     Model = DataCardValue2.Selected.Model
     ),
     Condition: Dropdown2.Selected.Value,
     Price: Int(DataCardValue4.Text),
     Name: 
     Concatenate(
     DataCardValue1.Selected.Result,
     " ",
     DataCardValue2.Selected.Model
     ),
     User: 
     LookUp(
     Users,
     'Full Name' = aPatch.'Full Name'
     )
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for helping. I found another solution by trial and error. I went with this solution:

    ForAll(DataCardValue10.SelectedItems,
     Patch(
     'IT Assets',
     Defaults('IT Assets'),
     {
     'IT Model': LookUp(
     'IT Models',
     Brand = DataCardValue1.Selected.Result And Model = DataCardValue2.Selected.Model
     ),
     Condition: Dropdown2.Selected.Value,
     Price: Int(DataCardValue4.Text),
     Name: Concatenate(
     DataCardValue1.Selected.Result,
     " ",
     DataCardValue2.Selected.Model
     ),
     User: ThisRecord
     }
     )
    )

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard