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.

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.
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.

@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.
genarich
Helper V
Helper V

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

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,686)