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

Community site session details

Session Id : uhizdBQLn3+eYNR0MuiDVz
Power Apps - Building Power Apps
Answered

Populate combobox with selected gallery item

Like (0) ShareShare
ReportReport
Posted on 22 May 2023 12:19:35 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)
  • la09 Profile Picture
    90 on 23 May 2023 at 13:04:25
    Re: Populate combobox with selected gallery item

    Hi,

     

    The formula is in the DefaultSelectedItems and there is no error, its just not pulling the person through. Here is the formula:

     

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

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 23 May 2023 at 11:50:26
    Re: Populate combobox with selected gallery item

    Hi @la09 ,

    Put the formula in DefaultSelectedItems property of combobox.
    Can you please share error message and the formula you have used.

  • la09 Profile Picture
    90 on 23 May 2023 at 11:28:31
    Re: Populate combobox with selected gallery item

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

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 23 May 2023 at 10:26:27
    Re: Populate combobox with selected gallery item

    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 23 May 2023 at 09:50:30
    Re: Populate combobox with selected gallery item

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

  • la09 Profile Picture
    90 on 22 May 2023 at 13:25:19
    Re: Populate combobox with selected gallery item

    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 22 May 2023 at 13:22:16
    Re: Populate combobox with selected gallery item

    Perfect, thank you!

  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 22 May 2023 at 13:20:45
    Re: Populate combobox with selected gallery item

    Hi @la09 ,
    Try using below formula - 

    [If(varViewRequestAdmin,
    gal_myapprovals_myrequests.Selected.'Job Title',
    Parent.Default)]
  • la09 Profile Picture
    90 on 22 May 2023 at 13:18:19
    Re: Populate combobox with selected gallery item

    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

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on 22 May 2023 at 13:13:43
    Re: Populate combobox with selected gallery item

    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.


     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 892 Most Valuable Professional

#2
Power Apps 1919 Profile Picture

Power Apps 1919 356

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 310 Super User 2025 Season 2

Last 30 days Overall leaderboard