cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Combobox, but no .Selected.Value option

Hello,

I'm doing PowerApps forms without Form Controls (ha!) and ran into a special case here I havent seen before. 

Scenario:

  • User Patched a partially completed "form" (not a form control) to Sharepoint list.
  • Now, they select the partially completed record from a Gallery.
  • Click "Complete Form" button
  • Complete remaining fields
  • Submit Button Patch function has error because the combobox is missing .Selected.Value (but its NOT an option!)
    • Nothing past ".Selected" is available as a choice.

Controls:

  • PartialFormGallery
    • Items:
      • Filter(FormResults, status = "incomplete")
  • CompleteForm Button
    • OnSelect:
      •  ClearCollect(colPartialForm, 
            Filter(FormResults, ID = PartialFormGallery.Selected.ID));
        
        Set(varPartialForm, true)
  • Combobox on "form" screen
    • Items:
      • If(varPartialForm,
            colPartialForm.LocationName,
            sharepointList.LocationName
        )
    • Works fine; whether a partial form or a new form, data is displayed correctly.

The Problem:

  • The Patch statement on the submit button does not have an option available beyond "Selected" (or "SelectedItems". 
  • This is usually Selected.Value for comboboxes like this.
  • Submit button
    • OnSelect:
      • Patch(
            FormResults,
            Defaults(FormResults),
                {
                    locationCombobox: combobox.Selected           //<--NO .Selected.Value/Result
                }
        )

Can anyone see whats going on here and how I might rectify it?
Thank you!

 

5 REPLIES 5
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Combobox, but no .Selected.Value option

Hi @ericonline

What's the Items property of the Combobox?

What columns does the Combobox have?

Super User
Super User

Re: Combobox, but no .Selected.Value option

Hi @Mr-Dang-MSFT,

Thanks for the assistance Smiley Happy

Combobox on "form" screen

  • Items:
    • If(varPartialForm,
          colPartialForm.LocationName,
          sharepointList.LocationName
      )
  • Columns
    • Either LocationName of the Partial Form Collection or the LocationName column of a Sharepoint list of locations.
    • Depends on whether its a New or Partially Completed form
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Combobox, but no .Selected.Value option

Ah, you reduced the table into the column LocationName. I understand now.

 

Normally, you reference a dropdown menu by:

ComboBox.Selected.Value

where Value is the text that is currently displayed. But the ComboBox in this situation only has one column, LocationName. You would reference it as:

ComboBox.Selected.LocationName

Make sure the combobox has the correct fields selected to show. What column is shown in display and search fields? What do you have defaultselecteditems set to?

 

Finally, I would recommend trying this: do not pare down the table to one column. This may break things across your app since you're now using all columns instead of the one, but it might also resolve an issue where elsewhere in your app you might be referencing records of different sizes.

If(varPartialForm,
    colPartialForm.LocationName,
    sharepointList.LocationName
)

 

Super User
Super User

Re: Combobox, but no .Selected.Value option

Hm. 

RE: Referencing combobox as .Selected.LocationName:

  • There is no options after .Selected.
  • Dot notation beyond "Selected" is not available for this control

RE: Columns in display and search:

  • Strange! Only the default column names from the Sharepoint list are showing
  • image.png
PowerApps Staff Mr-Dang-MSFT
PowerApps Staff

Re: Combobox, but no .Selected.Value option

@ericonline, my hunch is that your collection and your SharePoint table are not the same shape. So when you use that if statement, it returns one set of columns for the collection, and another set of columns for the SharePoint list.

 

Here's a test:

  1. Create two comboboxes.
  2. Set one combobox to the collection.
  3. Set the other combobox to the SharePoint list.
  4. Observe.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 190 members 5,360 guests
Please welcome our newest community members: