Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

How to Control Combobox and Dropdown in a New Row in a Gallery

(0) ShareShare
ReportReport
Posted on by 43

Hello!

 

I have an embedded canvas app set up to mimic an excel sheet where users can add new rows and edit existing ones. It pretty much functions as needed with two exceptions, and I'm not sure how to tackle them.

 

1. I need the Milestone Status dropdown when a new row is added to default to Active. I did figured out how to get SOMETHING to show up by setting the AllowEmptySelection to false, but whatever shows up seems to be based off of whatever status is the first row.

 

2. I need the Associated Project combobox when a new row is added to show up as whatever project the user is currently in. In the example below, I have navigated to the canvas app via the project Test 2.  It is correct for the existing rows to be whatever they are, in this case Test 1, but when a new item is added, it should look to the context and grab that project, in this case Test 2. Currently it defaults to nothing. 

 

 

sjd889_0-1671140782750.png

 

 

Any help is appreciated!

 

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: How to Control Combobox and Dropdown in a New Row in a Gallery

    Hi @sjd889 ,

     

    I can imagine it will look something like the below:

     

    Coalesce(
     ThisItem.'Associated Project',
     LookUp(
     colProject,
     Project = ModelDrivenFormIntegration.Item.'Project Name'
     )
    )

     

    Both arguments should return a record.

  • sjd889 Profile Picture
    43 on at
    Re: How to Control Combobox and Dropdown in a New Row in a Gallery

    Okay! I figured out that I needed to enable the ModelDrivenFormIntegration to get the context. I was able to get the contextual project name with the code ModelDrivenFormIntegration.Item.'Project Name' which is awesome, and I am putting it into the coalesce with the lookup statement I know works for pulling the list of project options and it's cranky because the lookup statement is a record value and the modeldrivenformintegration piece is text.

     

    Any ideas on how to adjust this to make the comparision valid?

     

    Coalesce(LookUp(
    colProject,
    Project = ThisItem.'Associated Project'.Project),
    ModelDrivenFormIntegration.Item.'Project Name')

  • sjd889 Profile Picture
    43 on at
    Re: How to Control Combobox and Dropdown in a New Row in a Gallery

    Okay! Was able to get it by changing it to Coalesce(Text(ThisItem.'Milestone Status'), "Active").

     

    Still not clear on what to add to the formula for the second one. Currently in DefaultSelectedItems I have:

     

    LookUp(
    colProject,
    Project = ThisItem.'Associated Project'.Project

     

    So I imagine

    Coalesce(

    LookUp(
    colProject,
    Project = ThisItem.'Associated Project'.Project), ????)

     

    But not sure what to put there because how does it know which project the user is currently in? This needs to be dynamic and not just me telling it a project name the way I am telling it a status in the other scenario.

     

  • sjd889 Profile Picture
    43 on at
    Re: How to Control Combobox and Dropdown in a New Row in a Gallery

    Thanks for the response! Just tried the first one really quick and Coalesce(ThisItem.'Milestone Status', "Active") leads to an error saying it was expecting an OptionSetValue but received a Text value instead. How do I correct that?

  • BCBuizer Profile Picture
    22,027 Super User 2025 Season 1 on at
    Re: How to Control Combobox and Dropdown in a New Row in a Gallery

    Hi @sjd889 ,

     

    For both of your questions you can use the Default property of the controls:

     

    1. 

    Coalesce(ThisItem.'Milestone Status',"Active")

     2.

    Coalesce(ThisItem.'Associated Project', XYZ)

    You'll have to replace XYZ with a reference to the value/record for the selected project.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard