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 / LookUp a specific reco...
Power Apps
Answered

LookUp a specific record and Create Collection of certain values

(0) ShareShare
ReportReport
Posted on by 35
All - I am trying to lookup a record using the current user via the LookUp function.
Once I have the record, I would then like to build a collection via the ClearCollection function and write certain values from the record to that collection.
 
So far, I have the following and am stomped beyond here:
 
If(!IsBlank(LookUp(UserProfiles, Employee=currentUser), CREATE COLLECTION, DISPLAY MSG NO USER FOUND)
 
Any help - greatly appreciated.
Categories:
I have the same question (0)
  • Verified answer
    Nirav Raval (Akira28) Profile Picture
    153 Moderator on at
    Hi RH-25092337-0

    May be can you try the below code Button - OnSelect  🤞
     
    Set(
        foundUser, 
        LookUp(UserProfiles, Employee = currentUser)
    );

    If(
        !IsBlank(foundUser), 
        
        
        ClearCollect(
            userCollection, 
            {
                FullName: foundUser.FullName,
                Email: foundUser.Email,
                Department: foundUser.Department,
                JobTitle: foundUser.JobTitle
            }
        ), 
        
        
        Notify("No user found", NotificationType.Error)
    )

    If this post solved your issue, clicking 'Does this answer your question' will help others discover the solution and close the topic. If you found it helpful, a Like would be awesome!


    Regards,
    Nirav J Raval (Akira28)
     
  • RH-25092337-0 Profile Picture
    35 on at
     
    Thanks...this was exactly what I was looking for.
    As an alternative, I found that:
    (1) I could do the lookup for the profile in my first screen, and if found,
    (2) Open another screen (UserProfiles) and within there, I could set the "Items" property on the UserProfile to the LookUp and it would retrieve all the values. However, my original way (and the way for which you responded) is a cleaner approach...in my opinion and have adopted such.
     
    Thanks again.

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard