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

Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

What i am try to do is navigate to a screen where the screen value is a variable.

 

Below is the formula i came up with:

*** Navigate(LookUp(CLTSvc,SvcRqst = ScheduleGal.Selected.SchFMSvcID1.Text,SvcCore),ScreenTransition.CoverRight) ***

 

I tested the lookup function separately by using a label and it has no issues resolving. When combined with Navigate it becomes an issue. I understand that first argument should be a control or screen.

 

Is there a way to have a button navigate based on a lookup value from a collection?

 

thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

Hi @ZiadHamandi 

 

You would have to maintain the Screen object (hardcoded in the collection) 

You cannot get screen reference from SQL since SQL cannot store objects of type screen( only PowerApps understands it)

 

ClearCollect(colScreen,{Title:"Screen1",Screen:Screen1},{Title:"Screen2",Screen:Screen2}); - this would have to be hardcoded in the PowerApp

Here Screen1 and Svcreen2 are references to screen (not strings)

 

Navigate(LookUp(colScreen,Title="Screen1").Screen)

View solution in original post

8 REPLIES 8
Highlighted
Dual Super User II
Dual Super User II

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

Hi @ZiadHamandi 

 

It will not workin with a text value for screen name

it needs an actual reference to the screen 

 

so for example

ClearCollect(colScreen,{Title:"Screen1",Screen:Screen1},{Title:"Screen2",Screen:Screen2}); Navigate(LookUp(colScreen,Title="Screen1").Screen)

 

this will work

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Regular Visitor

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

Is there a way to have the values in an SQL table and then referenced in the Navigate function?

Highlighted
Dual Super User II
Dual Super User II

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

@ZiadHamandi 

 

No since you cannot save screen object type in sql

 

You can use the collection technique 

Create a collection which has 2 properties as shown in example I provided

Title - string 

Screen - actual reference

 

In sql you can store the title value as string

Highlighted
Regular Visitor

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

In my case I created an sql table and used ClearCollect to have collection which in turn used under my navigate formula to validate..

 

Highlighted
Dual Super User II
Dual Super User II

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

@ZiadHamandi 

 

sorry I did not understand

 

Did it work? share screeshot of the error in powerapps

Highlighted
Regular Visitor

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

SQLSQLCollectionCollectionErrorErrorFormulaFormula

Highlighted
Dual Super User II
Dual Super User II

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

Hi @ZiadHamandi 

 

You would have to maintain the Screen object (hardcoded in the collection) 

You cannot get screen reference from SQL since SQL cannot store objects of type screen( only PowerApps understands it)

 

ClearCollect(colScreen,{Title:"Screen1",Screen:Screen1},{Title:"Screen2",Screen:Screen2}); - this would have to be hardcoded in the PowerApp

Here Screen1 and Svcreen2 are references to screen (not strings)

 

Navigate(LookUp(colScreen,Title="Screen1").Screen)

View solution in original post

Highlighted
Regular Visitor

Re: Is there a way to have a button navigate to a screen based on a lookup field or value from a collection?

I guess there is no option around this for now..

thank you for your help

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,756)