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 / Check SharePoint list ...
Power Apps
Answered

Check SharePoint list when a user first uses app and write new record if user doesn't exist in list.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to develop a training track app and can't quite figure out a step. When a user opens the app I want it to check if the user has a record in a SharePoint list. If the user if opening the app for the first time and does no have a record I want the app to create a new record in the SharePoint list. 

 

The SharePoint list has a Name field and an User E-mail field, it also has fields for score that will be set to 0 on record creation. 

 

Thank you

Categories:
I have the same question (0)
  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

    In the OnStart property of the app

     

    Set(
     useremail,
     User().Email
    );
    If(
     IsBlank(
     LookUp(
     SPlist,
     email = useremail
     )
     ),
     Navigate(
     ScrNewUser,
     None
     ),
     Navigate(
     ScrFirst,
     None
     )
    )

     

    I prefer to use Email because names can sometimes be the same. In the formula on start, the app checks whether the user's email is in the list and if not, it goes to the screen for entering a new user. This screen will probably contain a Form set with its default mode as New 

    If a match to the lookup is found, (ie, its not blank), then it navigates to the standard opening screen for established users.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for your answer. That all makes sense.

     

    In your code SPlist is a variable? And then in the variable I define the location of the the SharePoint List?

     

    How would I go about making it creating a new record automatically instead of going to the new user screen?

     

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    SPlist a shorthand for the actual name of your SharePoint list that contains the names, email addresses and other demographic information about your users. FYI, PowerApps is built around screens that contain the controls used for viewing, editing and creating new records that are stored in the back end of your App, usually SharePoint lists, Excel tables, etc. The typical way of creating a new record is to use an EditForm that is a control on a screen. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Drrickryp 

    To make sure understand I would connect data. And then where SPlist is I would enter TrainingUsers for example?

     

    I was hoping I could build it more automated but if I built a screen and had the new user validate some basic data to have it built the new record that work. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Exactly so!  However, if you want PowerApps to do the work of setting up your screens and controls, I suggest that you save the URL for your SharePoint list then go to make.powerapps.com and select + Create on the left side of the screen and follow the instructions.  It will create a very nice 3 screen app from your list that you can look at and see how the various controls and functions are built in. No need to reinvent the wheel!_1.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you very much for your help! 

    I'll have to try the start from SharePoint option.  

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard