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 / How to Display SharePo...
Power Apps
Unanswered

How to Display SharePoint list text field value to ComboBox DefaultSelectedItems in PowerApps

(0) ShareShare
ReportReport
Posted on by 3

Greetings PA Experts!

I have a PowerApps page that contains a combobox (single select) named ComboBoxCondFuture.

It is not part of a datacard or a gallery.

The datasource is a SharePoint list named Responses. The list has a single line text field column named FutureCond

The text field in SharePoint is not a required field so there are empty values but the only other values in the column match those of the Combobox.

In PA, the combobox ComboBoxCondFuture Items property is defined as ["a","b","c","d"]

The combobox ComboBoxCondFuture DefaultSelectedItems property is defined as ["c"]    
The PowerApps page has a Submit button that is correctly updating the SharePoint column FutureCond from the ComboBoxCondFuture.Selected.Value via a Patch function.
There is also a collection named colResponsesNew being created with values from the Responses SharePoint list , but it is not being referenced by the ComboBox.
 
The problem is that while the patch function is updating the data correctly in SharePoint, the combobox is not displaying the selected value from the SharePoint list when the record is selected again in PowerApps, because the DefaultSelectedItems property is hard coded with "c". 
I have searched but have had no luck to determine how to correctly get the matching record value from the FutureCond text column in SharePoint to display. Ultimately, I would like the DefaultSelectedItems to conditionally display the static value "c" only if there is no value in the related SharePoint list field. 
Any assistance would be most appreciated. Many thanks in advance!
Categories:
I have the same question (0)
  • PowerNuggets Profile Picture
    360 on at

    Hi @mminor 

     

    I hope i understood you correctly, try below

    {Value:ThisItem.yourCoumnName}
    _____________________________________________________________________________________
    Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.

     

    MD

  • developerAJ Profile Picture
    4,628 on at

    Ultimately, I would like the DefaultSelectedItems to conditionally display the static value "c" only if there is no value in the related SharePoint list field. 

    if you are using a form than 

    If(IsBlank(ThisItem.FutureCond),"C",ThisItem.FutureCond)

     

    if you are not using form.

    the selected value from the SharePoint list when the record is selected again in PowerApps,

    you must be storing it someway variable or gal.selected so you can use it and check column value is empty or not. than apply same condition.

     

    but i would recommend doing this way . combobox should display empty if nothing is selected

    If(Formname.mode=Formmode.New,"C",ThisItem.FutureCond)
  • mminor Profile Picture
    3 on at

    Thank you for these responses! I should elaborate more on how the page is scoped. I am reverse engineering previous development, so apologies for the missing details.

     

    The power apps page does contain a form and a gallery, but to a different SharePoint list. The form/gallery data source is called G5.

    G5 has a foreign key relationship to the SharePoint list Responses through the ID field. ID in G5 matches IDKey in Responses.

     

    For each record in the G5 gallery there are 3 icons that could display. The visible property of the icon is determined based on the value in a field named Future in the collection ColResponsesNew.

    Below is the conditional icon's visible condition if Future field value is 'Conditional'

    If(

        Last(

            Filter(

                ColResponsesNew,

                Value(IDKey) = ThisItem.ID && Country = CountrySelectionDropdown.Selected.Country_Name

            )

        ).Future = "Conditional",

        true,

        false

    )

     

    When the icon is selected in the gallery record (Icon On Select property) this sets a variable to true.

    When the variable is true a new page section displays (see second screenshot)

    In the new page section there is a radio button named Future. If the Future selection is "Conditional" then the ComboBoxFutureCond is visible.

     

    ComboBoxFutureCond has Items property defined as ["a","b","c","d"]

    The combobox ComboBoxCondFuture DefaultSelectedItems property is defined as ["c"]    

     

    The group section of the page section has a submit button.

    The submit button On Select property is

     

    Set(IDSubmit,Last(Filter(ColResponsesNew,Country = CountrySelectionDropdown.Selected.Country_Name,

     Value(IDKey) = BrowseGalleryLocalPage.Selected.ID)).ID);

    Patch(

    Responses,

        LookUp(Responses, ID = IDSubmit),

        {

          FutureCond:

          ComboBoxCondFuture.Selected.Value)

        }

    );

     

    In the Responses SharePoint list, FutureCond is a single line text field.

     

    I tried to set a variable in the DefaultSelectedItems property but it isn't accepted.

     

    Set(FutureCondSubmit,Last(Filter(ColResponsesNew,Country = CountrySelectionDropdown.Selected.Country_Name, Value(IDKey) = BrowseGalleryLocalPage.Selected.ID)).FutureCond);

     

    Where is the best place to define the variable and what should be the proper syntax?

     

    Then in the DefaultSelectedItems for the ComboBoxCondFuture, would the statement be like so?

    If(IsBlank(FutureCondSubmit, "C", FutureCondSubmit)

     

    Thank you!

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 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard