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 / Populate combobox with...
Power Apps
Unanswered

Populate combobox with selected gallery item

(0) ShareShare
ReportReport
Posted on by 90

Hi,

 

I have a canvas app which includes a gallery populated by a collection.

When the user selects view item, it populates a form with the item selected, however all the items that are a combo box aren't populating with any value. If they aren't viewing from the gallery, the form is set to New, in which case the combo box should be blank.

 

Any ideas would be appreciated

Categories:
I have the same question (0)
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @la09,
    Can you please share the formula you are using.
    Try using the formula in DefaultSelectedItems property of combobox.

  • la09 Profile Picture
    90 on at

    I have tried a few, the latest one was on the DefaultSelectedItems and it was:

    If(varViewRequestAdmin,
    gal_myapprovals_myrequests.Selected.'Job Title',
    Parent.Default)


    however it gives the error 'Expected Table Value'

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @la09 ,
    What type of column is 'Job Title' it in the datasource - single line of text, choice - single or multi select, person/group, etc.?
    Can you also share formula written in Item property of form control.


     

  • la09 Profile Picture
    90 on at

    Job Title is the Title column in SP, however the others are a mix of Multi Line and people columns, and the way it is built is the combo box is what the user uses to select the item, and then the data card sat underneath is populated based on the value in the combo box

  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @la09 ,
    Try using below formula - 

    [If(varViewRequestAdmin,
    gal_myapprovals_myrequests.Selected.'Job Title',
    Parent.Default)]
  • la09 Profile Picture
    90 on at

    Perfect, thank you!

  • la09 Profile Picture
    90 on at

    Sorry, it works for the other fields, but not the people fields, any idea why? they stay blank but dont error

  • la09 Profile Picture
    90 on at

    @NandiniBhagya20 Sorry, do you know why the people field isn't working?

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @la09 ,
    The format used to set and update people field is a bit different. Try using below formula in DefaultSelectedItems property of people field is single select - 

    If(varViewRequestAdmin,
    {
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    Claims: "i:0#.f|membership|" & gal_myapprovals_myrequests.Selected.UserColumnName.Email,
    DisplayName: Office365Users.UserProfile(gal_myapprovals_myrequests.Selected.UserColumnName.Email).DisplayName,
    Email:gal_myapprovals_myrequests.Selected.UserColumnName.Email
    ,JobTitle:"",Picture:"",Department:""
    },
    Parent.Default)

    You will have to replace "UserColumnName" with people/person type column name in your datasource.

     

     



  • la09 Profile Picture
    90 on at

    Thanks, it is single select, however the above formula still keeps the field blank instead of pulling the data through

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