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 / Power Apps Custom Form...
Power Apps
Answered

Power Apps Custom Form connected to SharePoint List gets stuck first time using app

(0) ShareShare
ReportReport
Posted on by 40

I'm refreshing a previous post I made in hopes there is a fix.   I've tried every Reset you can to no avail.

 

Issue is when using a SharePoint list and customized form with Power Apps, and that power app uses the Office365 connector/data source, when a user goes into create a new item the very first time, it brings up the very first record in the SharePoint list (and NOT a new item form).   If you do NOT use the Office365 connector and just the list, there are no issues.

 

So, first time in for any new user when creating a new item, they get this dialog for "Allowing" the connections.  A few have had to "fix their connection" as well,   After clicking allow, a (mostly) blank new item form is NOT shown, and the first record in the list is.  If they cancel out, and just repeat creating a new item, everything works (with a blank new item form).

 

The "Item" property looked like this and hence why the "first" item is shown, but still makes no sense to me why this doesn't work.  I've tried every post in doing resetform's, etc. with no luck.

 

If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@'My SharePoint List']),SharePointIntegration.Selected)

 

 

Categories:
I have the same question (0)
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    If the form is opening with data from a record, then the form is opening in Edit or View mode. A form in New mode doesn't look at the item property, so that formula doesn't matter. When you click on a form button (New, Edit or View) in SharePoint it will open the Power Apps custom form and trigger the OnNew, OnEdit or OnView property of the SharePointIntergration control which sets the form mode.

     

    The question becomes is SharePoint triggering the wrong property or why is the OnNew property not setting the form mode to New or is the form not being reset.

  • pullesb Profile Picture
    40 on at

    Thanks Jeff!  Certainly a weird situation - especially since this is NOT a problem if you do NOT use the Office365 connector.    And, like I said, if the user simply exits out, and hits the "New" button a 2nd time, it works from then on out. 

     

    I can replicate it very easily with

     

    * Create a new list (setting security for a test account here as well)

    * Add a people column

    * Add a row manually through SharePoint standard form and populate Title with "This is the first row" and with someone other than the test account in the people column.

    * Customize forms (power apps),

    * Set default for people column to be If(FormMode.New,Office365Users.UserProfile(User().Email).DisplayName),Parent.Default)

    * Save and Publish

    * Sign in with test account using In-Private Window

    * Click on "New" - I have to click "Allow" on the connections.

    * First row shows up with the original row I created in the 3rd step here with "This is the first row".  -- WRONG!!!

    * Hit cancel

    * Click on "New" again, and now my test account name shows up (as that is who I am signed in as) and the Title column is blank.

     

    Only workaround I've found that at least doesn't throw the user the first row is to set a variable "varSelected" and populate that with the below on the "OnEdit" property of the SharePoint integration control.  Then, I set the "Item" property on the form to be "varSelected". 

     

    This variable is NOT set on the "OnNew", and at least this then just throws a "Getting data" screen they then just cancel out of, click on "New" again, and they are fine.   Strange!!!

     

    Set(varSelected, LookUp('Product Request Forms', ID = SharePointIntegration.SelectedListItemID)); EditForm(SharePointForm1)

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    I followed the steps and after my test account clicked allow connections it opened the form as new with the test user defaulted in the people field and nothing in the title field. I didn't make any changes to the form except to add the O365 User connector add the default formula. I did have to tweak the default formula but I don't think that has anything to do with the issue at hand.

     

    This is what I changed it to:

    If(FormMode.New,Office365Users.UserProfile(User().Email), Parent.Default)

  • pullesb Profile Picture
    40 on at

    Thank you for testing in your tenant!   Just want to confirm you added a (test) row first?

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    Yes, I added a test record with the me listed in the person field and test 001 in the title field. Then I took my test account and opened the same list in a private window. 

  • pullesb Profile Picture
    40 on at

    Thanks again!   Must have something unique in our tenant then that is causing this, and because it only happens with this Office365 connector, assuming it is that (even though it makes no sense).    

  • pullesb Profile Picture
    40 on at

    FYI that we've opened up a support ticket with Microsoft.  Walked them through the issue in a Teams call and they agreed something is not working correctly.  They could NOT replicate on their tenant unfortunately.   Will update this post with what we find.

  • Verified answer
    pullesb Profile Picture
    40 on at

    The solution for this was to change the default mode on the SharePoint form to "New" instead of "Edit".    

  • BKahat Profile Picture
    4 on at

    Hi Guys, 

    I am also facing Same issue on PRD as explained below.

    1. At first, click on "New" button, it shows controls and buttons disabled. (Which is not Expected)

    2. Click on "Cancel", it closes the form.

    3. Click again on "New" button, it shows controls and buttons enabled which is correct.

     

    Such kind of issue is not observed in DEV environment, and it is working smoothly without any error.

     

    So could you guys, suggest final solution if resolved from your end or provided by microsoft.

     

    Thanks in Advance

    Balasaheb Kahat

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard