cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
resolver101757
Helper II
Helper II

Using a dropdown box to navigate to a different screen and then set a downbox value to be the same

I have 4 identical screen for each company.  Each screen has a drop down box with company name.  If the company name is selected it takes me to that company screen.  I want to update the drop down box to the same screen.  How can i acheive this? 

 

On each of the combo boxes i have the following code on the on change :  

 

 

Switch(
    drpCompanyName1.SelectedText.Value,
    "TBL",
    drpCompanyName1.SelectedText.Value = "1";Navigate('Approve on hold invoices (1)'),
    "TBG",
    drpCompanyName2.SelectedText.Value = "2";Navigate('Approve on hold invoices (2)'),
    "TMK",
    drpCompanyName3.SelectedText.Value = "3";Navigate('Approve on hold invoices (3)'),
    "TBS",
    drpCompanyName4.SelectedText.Value = "4";Navigate('Approve on hold invoices (4)')
)

 

 

The drop down items are : 

["1","2","3","4"]

 

The above code does't work. if i have just the navigate, it works fine.  How do i get the text of the screen i am navigating to drop down box to match the screen that was last selected?

 

Switch(
    drpCompanyName1.SelectedText.Value,
    "TBL",
    Navigate('Approve on hold invoices (1)'),
    "TBG",
    Navigate('Approve on hold invoices (2)'),
    "TMK",
    Navigate('Approve on hold invoices (3)'),
    "TBS",
    Navigate('Approve on hold invoices (4)')
)
1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

Try this instead:

Switch(
    drpCompanyName1.SelectedText.Value,
    "TBL",
    Set(varScreenNumber,"1");Navigate('Approve on hold invoices (1)'),
    "TBG",
    Set(varScreenNumber,"2");Navigate('Approve on hold invoices (2)'),
    "TMK",
    Set(varScreenNumber,"3");Navigate('Approve on hold invoices (3)'),
    "TBS",
    Set(varScreenNumber,"4");Navigate('Approve on hold invoices (4)')
)

Then put this in the Default property of the dropdown on each screen:

varScreenNumber

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

1 REPLY 1
BCLS776
Super User
Super User

Try this instead:

Switch(
    drpCompanyName1.SelectedText.Value,
    "TBL",
    Set(varScreenNumber,"1");Navigate('Approve on hold invoices (1)'),
    "TBG",
    Set(varScreenNumber,"2");Navigate('Approve on hold invoices (2)'),
    "TMK",
    Set(varScreenNumber,"3");Navigate('Approve on hold invoices (3)'),
    "TBS",
    Set(varScreenNumber,"4");Navigate('Approve on hold invoices (4)')
)

Then put this in the Default property of the dropdown on each screen:

varScreenNumber

Hope that helps,

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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
Users online (1,512)