Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Powerapps Sharepoint.Integration Launch different forms OnNew and OnEdit

Like (1) ShareShare
ReportReport
Posted on 4 Sep 2024 08:51:47 by 27
So I have a PowerApps form and I am using the functionality on SharepointIntegration>OnNew to launch the form using the following code
Launch("https://apps.powerapps.com/play/<AppID>",{skipAppMetadata: "true", hidenavbar: "true"},
LaunchTarget.New);
 
RequestHide();
 
This is working fine but my issue on the Form I have 2 screens, Screen 1 Launches fine as this is onNew and works ok.  Now I have a 2nd
screen on the form that is used for when they want to edit an item from the SP list.  But how do i differentiate in the code to launch
the edit form OnEdit
  • Gskinner76 Profile Picture
    Gskinner76 27 on 09 Sep 2024 at 12:41:21
    Powerapps Sharepoint.Integration Launch different forms OnNew and OnEdit
     
    So I tried what you suggested and on SharepointIntegration I have 
     
    OnNew = 
    Launch("https://apps.powerapps.com/play/<AppID",{skipAppMetadata: "true", ScreenToNavigateTo: "NewIncidentTicket", hidenavbar: "true"},
    LaunchTarget.New);
    RequestHide();
     
    OnEdit = 
    Launch("https://apps.powerapps.com/play/<AppID>",{skipAppMetadata: "true", hidenavbar: "true", ScreenToNavigateTo: "NewIncidentTicket_EditView", ItemID:SharePointIntegration.SelectedListItemID},
    LaunchTarget.New);
     
    Then on App StartScreen I have put the code but i get an error see screen shot below
     
  • Suggested answer
    FLMike Profile Picture
    FLMike 27,286 on 05 Sep 2024 at 03:29:06
    Powerapps Sharepoint.Integration Launch different forms OnNew and OnEdit
    Hi,
     
    Add another parameter like this
     
    {skipAppMetadata: "true", hidenavbar: "true", ScreenToNavigateTo: "NameOfScreen"}
     
    Change the NameOfScreen to the Edit or the New screen depending on what you want the app to do
     
    Turn on the setting Use Navigate in App.OnStart (in the settings)
    OR
    Use a Home Screen
     
    If you use the App.OnStart do this
     
    Switch(Param(ScreenToNavigateTo),
        "ScreenNew",
          Navigate(YourNewScreenName),
        "ScreenEdit",
          Navigate(YourEditScreen),
         Navigate(SetADefaultFormNameHere)
    );
     
    Or use a Home Screen and use the OnVisible of the Home Screen
    Switch(Param(ScreenToNavigateTo),
        "ScreenNew",
          Navigate(YourNewScreenName),
        "ScreenEdit",
          Navigate(YourEditScreen),
         Navigate(SetADefaultFormNameHere)
    );
     
    Either way thats how you do it.
     

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,696

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,456

Leaderboard
Loading started
Loading complete