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 / Have default values in...
Power Apps
Answered

Have default values in form to match SharePoint list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

In the picture I have my PowerApps form on the left that will make changes to the SharePoint list on the right. The scribbled out text in my app is User().FullName which is currently matching the name in my SharePoint list.

 

For my Submit button I am using the following code to create a new record in the SharePoint if the name doesn't exist and make changes to a current record if it already exist.

 

If (
 LookUp(
 'SharePoint_List',
 Name = UserNameLabel.Text,
 Name
 ) = Blank(),
 SubmitForm(PowerApps_Form),
 Patch(
 'SharePoint_List',
 LookUp(
 'SharePoint_List',
 Name = UserNameLabel.Text
 ),
 {
 'This is a long list': Item1Toggle.Value,
 'This is an even longer list': Item2Toggle.Value,
 'Item 3': Item3Toggle.Value,
 'Item 4': Item4Toggle.Value,
 'Item 5': Item5Toggle.Value
 }
 )
)

 

 

However, I am having issues figuring out how to automatically change the toggle values in my app to match those of the SharePoint if the user name matches. Currently in my picture both of the user names are the same, so the toggles in my app should all be "Completed" since all 5 values are checked in my SharePoint. Thanks in advance!

help1.PNG
Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Write this on default of the Toogles:

     

    If( LookUp('SharePoint_List',Name = UserNameLabel.Text,Name).Field = Blank(),
     //IS EMPTY
     false,
     //CONTAIS CONTENT
     LookUp('SharePoint_List',Name = UserNameLabel.Text,Name).Field
    )

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,
    Gonçalo Nogueira

    Check my LinkedIn!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the quick response, the ".Field" is giving me issues and when I remove it nothing is changed. 

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    On that field write the name of your field...

     

    EXAMPLE:

     

    If( LookUp('SharePoint_List',Name = UserNameLabel.Text,Name).'Item 3'= Blank(),
     //IS EMPTY
     false,
     //CONTAIS CONTENT
     LookUp('SharePoint_List',Name = UserNameLabel.Text,Name).'Item 3'
    )

     

    Change the name for each toogle/field. 

    Those names are from your SP List

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    When I try to do that after the LookUp(), it is saying 

     Invalid use of '.' 

    Even when I just put a period after the LookUp() nothing is showing up in IntelliSense. 

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Nogueira1306_0-1638552137198.png

     

    In one of my apps.

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    If this is a form, then why the patch?  This should all be done with the SubmitForm action.

    Set the Item property of your form to : 

    LookUp('SharePoint_List', Name = UserNameLabel.Text) 

    Don't change the datacards and toggles as they will already be "wired" to your underlying data and will then show the correct values.

     

    I hope this is helpful for you.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    When I try that it says I am creating a circular reference between properties. 

     

    @Nogueira1306 I don't see that option, could it be because you are using a gallery instead of a form? 

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    If you have a circular reference then you have made some modifications to your form that are going to be a problem.  My guess is that you have some UserNameLabel in your form...it should not be there.

    If the formula for the label is : User().FullName then your Item property should change to:

    LookUp('SharePoint_List', Name = User().FullName) 

    You have a very simple form shown in your photo - there should be no modifications to it needed to achieve what you are trying to do other than specifying the correct Item to show.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you so much!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 426

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard