cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TesDA
Continued Contributor
Continued Contributor

Power App ComboBox not defaulting to selected option when going back to screen

I have a combox field in a form that should return to what was selected when a user goes back to the page from a page further on:

 

Screen - scrForm1

Card: ProjDir_DataCard2

-Sends data to App_PAFNewProj_Main sql table in sql server

 

ComboBox: ProjDir_ComboBox

Items - Sort(Filter(EmployeeData, DirectorFilter = "Director"), 'Employee Name')

SelectMultiple - False

Default - blank

DefaultSelectedItems -

If(varFormMode = "edit",
   {ID: LookUp(App_PAFNewProj_Main, ID=varRecord.ID), Value: Gallery_Main.Selected.ProjDirName},
   If(varBackScr2 = "back",
      LookUp(App_PAFNewProj_Main,ID = varRecord.ID),
      Blank()))

Use the gallery if the person is coming from the gallery, if they are using the back button do a lookup. The lookup is what is not working

 

When the form is submitted:

Set(varRecord,Form1.LastSubmit);Navigate(scrForm2_EQRAttach,ScreenTransition.None)

 

Screen 2: scrForm2_EQRAttach

BackButton - Icon7

OnSelect - Set(varBackScr1, "back"); Set(varBackScr2, "back"); ResetForm(Form1); Navigate(scrForm1, ScreenTransition.Fade)

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@TesDA 

Yes, your DSI (Default Selected Items) property will never match the Items records...

Your DSI property should be: 

Coalesce(Parent.Default, Gallery_Main.Selected.ProjDirName)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

1 REPLY 1
RandyHayes
Super User
Super User

@TesDA 

Yes, your DSI (Default Selected Items) property will never match the Items records...

Your DSI property should be: 

Coalesce(Parent.Default, Gallery_Main.Selected.ProjDirName)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

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