web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Setting DataSource / I...
Power Apps
Suggested Answer

Setting DataSource / Items property of combobox

(1) ShareShare
ReportReport
Posted on by 56
I have a powerapp connected to a Sharepoint list.  It has some controls including a combobox.
When I insert a record it's fine.  When I try to update the record it says the combobox is empty even though I can see that an item has been selected.
 
I've looked at another powerapp that works.  It ingested the Sharepoint list into a collection, so I tried to do that.  However, when I select the collection as the data source it says None even though the items property has the name of the collection as you can see in the screenshot.
Categories:
I have the same question (0)
  • Mark Nanneman Profile Picture
    991 Super User 2025 Season 2 on at
    What's the purpose of the combobox in question?  In your screenshot it shows a combobox called "ComboBox1" that looks like something you added yourself, and not something that came with the Form control.  What is colRetailStrategies?  Is that supposed to be the options for the combobox?

    If you want to create your own controls and have them drive updates to a record, you should use Patch().  You have to be careful modifying a form's cards because it can cause problems when you try to submit the form or when the form displays data.
     
  • WarrenBelz Profile Picture
    153,073 Most Valuable Professional on at
    Hi @AH-02011058-0​​​​​​​
    You cannot use a Collection as the Item of a Form - it needs to be a SharePoint List.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee
  • AH-02011058-0 Profile Picture
    56 on at
    Thanks both.
     
    I want to use a collection as the items property of a combo box not a form.
     
    colRetailStrategies is the name of the collection I want to use as the items property of the combobox.  I'm using the Patch function, but it's saying the combo box is blank even though I can see something has been selected.  It's in update mode, so the DefaultSelectedItems property is taken from the Sharepoint list ie
    [ThisItem.HowAlignedToRetailStrategy]
  • Suggested answer
    Anujjain Profile Picture
    20 on at

    hey,

    Remove all the source from the combo box  and 

    try to add the source from the properties panel on right side and the field. then select field as value.

    Hope this will solve your problem


       
  • AH-02011058-0 Profile Picture
    56 on at
    On the second screenshot the data source says None.  I click on "Depends on", select the collection and it momentarily changes then reverts to none.  It's OK if I use a Sharepoint list.  
    The thing is, I've been able to use collections for combo boxes in other powerapps.  That's what makes me think that my inability to use a collection as the source is why it's showing as empty in the Patch statement.
  • AH-02011058-0 Profile Picture
    56 on at
    I'm not sure if this is helpful.
    The user come to the screen by selecting the item in a gallery from the browse screen.  Here is the code for the OnSelect property of the gallery.
     
    ResetForm(EditForm1);
    Navigate(EditScreen1,
    BorderStyle.None,
        {
            ParamRecord: LookUp(
                RetailActivityRequest,
                ID = ThisItem.ID
            ),
            //ParamRecordId: ThisItem.ID,
            ParamRecordMode: "Edit"
        });
     
     
    Here is the code for OnVisible property of the screen where the errant combobox resides.
     
    Refresh(relevantList);
    
    If(IsBlank(ParamRecord),
        Select(btnLoadRecordByReqId);    
    );
    
    UpdateContext(
        {
            blnInSubmit: false,
            
            varMessageText:""
        }
    );
    UpdateIf(errorMessages, true, {Active: false});
     
     
    btnLoadRecordByReqId is an invisible button.  The Onselect code for it is:
     
    With(
        {
            lclLeaverId: Coalesce(Value(Param("ReqID")), -1)
        },
        UpdateContext(
        {
            ParamRecordId: lclLeaverId,
            ParamRecord: If(lclLeaverId >0, LookUp(RetailActivityRequest,ID=lclLeaverId)),
            ParamRecordMode:"Edit"
        });
        EditForm(EditForm1);    
    )
     
  • AH-02011058-0 Profile Picture
    56 on at
    I think I've found the problem.  I was using cmbName.Selected.RetailStrategy.  However, this is a multi select combo box, so I should use cmbName.SelectedItems.  I'll see if that works.
  • AH-02011058-0 Profile Picture
    56 on at
    No good.  I changed it to single choice combo and it still says blank.
  • Suggested answer
    AH-02011058-0 Profile Picture
    56 on at
    I was setting the DisplayMode of the combo box.  I should have set the DisplayMode of the combobox to match the displaymode of the parent datacard and amended the displaymode of the datacard.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard