Search code examples
sharepoint-2013defaultdropdownpowerapps

Powerapps - Pick "Title" text from Browse screen and add it as default to Form screen dropdown Options


I am creating an app with 3 screens -

  1. Home screen - normal text based screen with two buttons - View All-All Records Gallery. The items for this gallery are coming from SP List1 FormScreen - Form which submits data into SP List2
  2. ViewAll Screen - This contains gallery with Title, Subtitle, Body and Navigation arrow. Data for this gallery is coming from SP List2. Clicking on the arrow should navigate to FormScreen
  3. FormScreen - This has data source as SP List2

I wanted to pass "Title" value from ViewAll screen and set it as default for dropdown on FormScreen once I click on the Navigate arrow.

I do not have EditScreen/EditForm. If I directly come from HomeScreen to the FormScreen the form should open in new mode with no defaults set for the dropdown but if I am coming from ViewAll screen to the FormScreen then it should pick up the Title value and set it as a default for one of the dropdown control on FormScreen.

So far I have tried setting the global variables but no luck -

Navigate(FormScreen, transition.fade, {myValue:ThisItem.Title})

To debug this issue I added a temporary text input on the FormScreen and have set its Text property to myValue and it works fine but with dropdown it is not showing anything.


Solution

  • I assume that you got Title value in your DropDown, if you want to add this to DropDown you have to use collection.

    Home Screen - OnVisible event: Set(myDefaultDropDownValue, "")

    Navigation arrow OnSelect event: Set(myDefaultDropDownValue, Title.Text)

    DropDown on FormScreen Default value: myDefaultDropDownValue