cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
genarich
Helper V
Helper V

StartScreen function to specific screen not showing item information

Hi,

I moved the deep link 'Navigate' function from the OnStart property to StartScreen

 

Old code (OnStart):

If(
    !IsBlank(Param("ID")),
    Set(
        varRecord,
        LookUp(
            'Travel Request',
            ID = Value(Param("ID"))
        )
    );
    Navigate(
        PendingApproval,
        ScreenTransition.Fade
    );
);

New code (StartScreen):

If(!IsBlank(Param("ID")),
    PendingApproval,
    LandingScreen
)

 

No errors were detected and I successfully published it.

 

However, on the email function that is required for user to navigate to a specific screen showing the selected item by clicking on 'here' - it navigated to the correct screen below but it did not show the item record.

 

genarich_0-1636841600925.png

 

Code used for the email:

<p>Please click <a href='" & appURL & "&ID=" & varRecord.ID & "'>here</a> to view the details.</p>",

 

 Any thoughts on where the issue is? Thank you in advance!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

The problem is that in the changed code you aren't looking up and setting varRecord based on the parameter being passed to the screen.  Assuming the travel request form is set to varRecord just change the Item property of the form to an IF() statement that uses the parameter passed in to set the Item property by using the Lookup() that you used to use for varRecord.  You could also put that set in the OnVisible property of the screen.  But coding it directly is probably better performance.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

WarrenBelz
Super User
Super User

Hi @genarich ,

Welcome to the new StartScreen . . .

I have exactly the same issue that it seems to execute before OnStart and you cannot get to a deep linked record if it is set in OnStart. I have currently just put it all back and turned on the switch in the Retired Setting as my issues are more extensive than this. However try putting this at the ScreenOnVisible of PendingApproval

If(
   !IsBlank(Param("ID")),
   Set(
      varRecord,
      LookUp(
         'Travel Request',
         ID = Value(Param("ID"))
      )
   )
)

 

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.

Visit my blog Practical Power Apps

View solution in original post

6 REPLIES 6
Pstork1
Dual Super User
Dual Super User

The problem is that in the changed code you aren't looking up and setting varRecord based on the parameter being passed to the screen.  Assuming the travel request form is set to varRecord just change the Item property of the form to an IF() statement that uses the parameter passed in to set the Item property by using the Lookup() that you used to use for varRecord.  You could also put that set in the OnVisible property of the screen.  But coding it directly is probably better performance.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

WarrenBelz
Super User
Super User

Hi @genarich ,

Welcome to the new StartScreen . . .

I have exactly the same issue that it seems to execute before OnStart and you cannot get to a deep linked record if it is set in OnStart. I have currently just put it all back and turned on the switch in the Retired Setting as my issues are more extensive than this. However try putting this at the ScreenOnVisible of PendingApproval

If(
   !IsBlank(Param("ID")),
   Set(
      varRecord,
      LookUp(
         'Travel Request',
         ID = Value(Param("ID"))
      )
   )
)

 

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.

Visit my blog Practical Power Apps

I just put together a prototype and it works fine.  Here are the details.  

  • There are two screens, Screen1 with a gallery and Screen2 with a form.
  • App.StartScreen is set to Screen2
  • The Items property of the form on Screen2 is set to 

 

If(IsBlank(Param("DogId")),Gallery1.Selected,LookUp(Dogs,ID = Value(Param("DogId"))))

 

  • If I navigate directly to the app it shows the first record from the Gallery on Screen 1 in Screen2
  • If I use a Deep link with the parameter "DogId" it shows the record of the ID in the parameter
  • If I navigate from Gallery1 it shows the record of the selected.ID from the Gallery

What scenario am I missing?

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

@Pstork1 ,

Yes, you can certainly get the deep-linked ID by referring to the incoming parameter (I suggested setting the Variable OnVisible, but I can see your conditional Item will also work). The issue that I have found is when you are using incoming parameters in App OnStart to set a heap of other things looking up lists the navigate fires before they are set (I have a production app with up to 8 incoming parameters and all the logic of what to do in OnStart - which also includes navigation). I am happy for the moment to turn the switch on and see what MS comes up with for the promised "workaround".

For that kind of logic I go back to the use of a "Splash Screen" with a timer to cover the time required to load all the parameters etc.  Then set the Splash Screen as the App.StartScreen and navigate using the parameters on TimerEnd.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

genarich
Helper V
Helper V

Thank you!! Both idea solutions worked @WarrenBelz @Pstork1 

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,818)