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 / Retrieve info from Sha...
Power Apps
Answered

Retrieve info from SharePoint with conditional logic

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello!

I am trying to build a performance management app. Currently I am trying to figure out the logic whenever user login the app, it will retrieve info from a list in SharePoint called Staff Profile. I'm using current login user email for lookup.
I used this formula in OnStart:

 

 

ClearCollect(UserProfile, LookUp('Staff Profile', Email=CurrentUserProfile.Email));

//Get KPI Record
Set(CurrentUserID, LookUp('Master KPI', StaffEmail=CurrentUserProfile.Email, ID));

 


However, there is a condition when retrieving the info, that IF no email is found in the list OR ManagerID (a number column in SP) = 0, it will display a label/message "No submission is needed".

If the staff info is found/matched, it will retrieve record from another SP List, Master KPI based on the user email. But if no record match the email, it will populate the necessaries information retrieved from Staff Profile.

I am having trouble working out the logic/formula and would appreciate guidance for this.
Thank you!

Categories:
I have the same question (0)
  • Verified answer
    JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    I would start by creating another variable to use in the visible property of your label and setting it to false and then do something like this:   This collects the user profile information if it exists.  If it doesn't the UserProfile collection should be empty.   If it's empty, then display the message, if it's not empty then get the KPI information.

     

    ClearCollect(UserProfile, LookUp('Staff Profile', Email=CurrentUserProfile.Email));
    
    If(
     IsEmpty(UserProfile), Set(varMessageVisible, true),
    //Get KPI Record
    Set(CurrentUserID, LookUp('Master KPI', StaffEmail=CurrentUserProfile.Email, ID))
    );

     

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

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard