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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ForAll looping through...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by

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
    153,032 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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard