cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DavidGrd
Regular Visitor

App.StartScreeen missing contextual variables

The new property App.StartScreen is great but we are missing the opportunity to set contextual variables for the target screen... A bit disturbing. Does it mean I have to review my logic with a global variable instead??

8 REPLIES 8
StalinPonnusamy
Community Champion
Community Champion

Hi @DavidGrd 

 

Contextual variables' scope is within the screen which is temporary data. When using anything outside the screen or across multiple screens then we need to use global variables.


Thanks,
Stalin - Learn To Illuminate

Thanks @StalinPonnusamy for your reaction

When using the Navigate() function in the OnStart property of the app, we could pass contextual variables.

Now with the StartScreen property, it is no longer possible to pass the contextual variables. That is my concern.

Mostafa
Microsoft
Microsoft

@DavidGrd could you explain what are you trying to achieve? I am trying to get my head around the use case you are trying to achieve when passing context variable to a screen using StartScreen. 

Sure @Mostafa 

Here is an example

 

App.OnStart = 

 

If(
  Value(Param("ID")) > 0,
  ViewForm(bookingForm);
  Navigate(
    'Booking Screen',
    ScreenTransition.None,
    {
      ctx_selectedRecord = LookUp(
        bookingList,
        ID = Value(Param("ID"))
      )
    }
  )
)

 

 

How would I achieve something similar with the new App.StartScreen property?

 

Thanks!

Mostafa
Microsoft
Microsoft

@DavidGrd  The way I would think about it that you could do this now in the OnVisible of the target screen(s). Not ideal but this is a valid use case that we could simplify in the future. so you don't have the same code in multiple screens.

StalinPonnusamy
Community Champion
Community Champion

Hi @DavidGrd 

 

We can directly set the Item property of Form to

LookUp(
        bookingList,
        ID = Value(Param("ID"))
      )

 

 

@Mostafa I thought about the OnVisible property of the target screen but in some other case scenario it would overwrite the definition of the context variable set in other places, so it doesn't work.

@StalinPonnusamy  in a very simple scenario yes, but not in my case.

the Item property of the Form is set to ctx_selectedRecord => where ctx_selectedRecord is defined differently from different locations in the app.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,403)