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 / StartScreen for ShareP...
Power Apps
Unanswered

StartScreen for SharePoint list form customized in Power Apps

(0) ShareShare
ReportReport
Posted on by 16

Hello All,

 

I searched my query in the PA forum but could not find what I am trying to achieve.

 

Scenario:

I have 2 screens namely screen A and screen B. The screen A has to be displayed when new button from SP list is clicked. The screen B has to be displayed when edit button from SP list is clicked.

 

Note: In tree view in power apps studio first screen is screenA.

 

What I tried:

When I click on new button it works fine. It opens screen A. But when I edit any list item then first it opens screen A and gets redirected to screen B. After researching I found start screen function in app object in Power Apps. Here I have tried below code in start screen function.

 

If(IsBlank(SharePointIntegration.Selected),ScreenA,ScreenB)

 

But its not working. Please help me! Why its not opening respective screen directly

Thank you!

Categories:
  • Sumaira_Noor Profile Picture
    18 on at

    @bhajan 

    Set a variable on new button example Set(var1,"new")

    Set a variable on Edit button example Set(var1,"edit")

     

    If(var1="new",ScreenA,If(var1="edit",ScreenB))

     

    Please accept the solution if this helped you out

  • bhajan Profile Picture
    16 on at

    @Sumaira_Noor 

    Thank you for your reply.

    I tried the same but its showing "Global variables are not allowed in StartScreen".

  • Sumaira_Noor Profile Picture
    18 on at

    OnNew - NewForm(SharePointForm1)

     

    OnEdit - EditForm(SharePointForm1)

     

    Is above code set on your SharePointIntegration OnNew and OnEdit ?

     

    @bhajan 

  • bapala Profile Picture
    247 on at

    Hi @bhajan,

    You need to leverage the SharePoint ID column to get this done. Try below formula on your app 'StartScreen' property. It should work for you:
    If(IsBlank(SharePointIntegration.Selected.ID),EditFormScreen2,NewFormScreen1)

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • bhajan Profile Picture
    16 on at

    @Sumaira_Noor 

    Yes it is set in OnNew and OnEdit function. But its its showing same error.

  • bhajan Profile Picture
    16 on at

    @bapala 

    Thank you for your reply.

    I have commented all the code in OnNew and OnEdit and set your code in StartScreen but now its showing only screen A all the time even if I click on edit button as well.

  • bapala Profile Picture
    247 on at

    Hi @bhajan,

     

    I have tried from my side and it worked for me without any issue.

     

    1. In SP, Onclick on New button, it navigated to Screen1

    2. For Edit, Seleted a record in SP and clicked on 'Edit' option it navigated to Screen2

     

    Is this you are trying?

     

     

     

     

     

  • bhajan Profile Picture
    16 on at

    @bapala 

    Yes I am trying the same.

    Let me explain this again. The complete requirement is shown in image below.

    bhajan_0-1659515762734.png

    So, On new button click from SP list, Screen A should be displayed and on clicking save button from screen A, It should redirect to screen B. This i am able to do.

    But when i click on edit button it goes to screen A and then in 1 second redirects to screen B.

    I am trying to achieve is when i click on edit button, directly it should open screen B.

     

  • OliverR-82 Profile Picture
    623 on at

    Has anyone found a solution for this? I'm trying the exact same thing and I'm having the exact same problem as @bhajan .

     

    To recap: I'm using a standard SharePoint list with a PA custom form. If the user clicks on the 'New' button (in the standard SharePoint list, NOT in the custom form!! this is very important because some people here are giving wrong suggestions), I want the form to open on screen A. If the user clicks on the 'Edit' button in the standard list, I want the form to open on screen B. To avoid any confusion, I am talking about these two buttons in the SP list command bar. 

    OliverR82_0-1662403333974.png

     

    These buttons cannot be referenced inside PowerApps as far as I know, so it's not possible to set an OnSelect or any other property.

     

    In the App.StartScreen property I have the following code:

    OliverR82_1-1662403456934.png

    For debugging purposes I have added a label on the form that says true or false to indicate whether or not the if-condition is true.

     

    However, no matter which case - true or false - the form always opens on screen A. I've been pulling my hair out over this.

     

    I have tried all the variations you can think of, including IsBlank(SharePointIntegration.SelectedItemID) or IsEmpty(SharePointIntegration.Selected.Title) or whatever... the result remains the same.

     

    I tried to work around this by putting a Navigate statement in scrA.OnVisible that would navigate to scrB if selected item was not blank, but apparently you're not allowed to use Navigate() in the OnVisible property. You cannot use Navigate() in the App.OnStart property, either so... I've no idea how else I can get this to work.

     

    I feel like the above code should work and that this is a bug...

     

    Oh btw, I have also set the OnNew and OnEdit properties of the SharePointIntegration connector to the correct screens, but this makes no difference whatsoever.

     

    Any tips would be greatly appreciated because this really does look and feel like a bug to me...

  • bhajan Profile Picture
    16 on at

    No matter what you set on click event of New or Edit buttons of SP list in PA. It will always show the screen which is at the top in the tree view the left pane of PA studio.

     

    I found work around to this. Just create a new blank screen and show a loader only in this screen like below.

    Just keep this screen at first place in tree view.

     

    bhajan_0-1662405193111.png

     

    So, whatever button you click New, Edit or View, first it will open this loader screen. Now, In OnNew and OnEdit properties of SharePointIntegration object, Use below functions:

    1. OnNew - Navigate(ScrAdd, ScreenTransition.None);

    2. OnEdit - Navigate(ScrEdit, ScreenTransition.None);

     

    So, when you click new or edit button, PA will open your first loader screen and then will navigate to your respective screen.

     

    Plz let me know it helps to you. It worked for me.

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard