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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combo Box Default Valu...
Power Apps
Answered

Combo Box Default Value Coming from a collection if the a variable is true.

(0) ShareShare
ReportReport
Posted on by 2

I have an app that uses other SharePoint list and cascading combo boxes to make selections.  I'm looking to make another button to duplicate some of the information that was submitted on the last submission. The submit button creates a collection of the data points I need, and I have created a var "DuplicateNCR" that turns true when the duplicate button is pressed, while navigating you back to a new form, but I can't seem to get the default selection to pull in from the collection. below is the code for the default selection of the combo box. I'm not sure what I'm missing or if there is an easier way to accomplish this goal.  Thanks for any help. 

Default Sections.jpg 

Categories:
  • v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @OverRatedMelin 

    According to your description, you want to set the combobox defaultselectedItems in the Form .

    I test it in my side , it works good . 

    vyueyunmsft_0-1699586920366.png

    And this is my button-OnSelect:

     

    SubmitForm(Form1);
    Set(DuplicateNCR,true);
    Set(LastSubmit, Form1.LastSubmit );
    ResetForm(Form1);
    NewForm(Form1);

     

    We need to update the DataCard-Default property:

    vyueyunmsft_1-1699586980848.png

    And the Combo box  property is the Parent.Default like this, and for the combo box we do not put anything in the "Default" property.

    vyueyunmsft_2-1699587013018.png

     

    And when i select the "X" and click the button, the result is as follows:

    vyueyunmsft_3-1699587061947.png

     

     

     

    If I misunderstand what you mean, you can describe your needs and your expected outcomes in detail so that we can better help you.


    Best Regards,

    Yueyun Zhang

     

     

     

     

     

     

     

     

  • OverRatedMelin Profile Picture
    2 on at

    Thanks for the help! 

    I think there is maybe some misunderstanding. Below a sample of the submit button action pulling in single row of data into a collection. Submitting the record and setting the duplicateNCR to false.  

    Submit button.jpgLast Submitt Collection.jpg

    The duplicate button in the success screen onselect sets a new form with the duplicateNCR being true.

    Duplicate Record Button.jpg

    I have set the combo box default = blank, defaultselection = parent.default, moved the if statement from the combo box to the card (code below). I don't understand your "This.Item.Choice" in your example. It looks like you might just being using a variable instead of a collection. 

     

    Card Default : If(DuplicateNCR,{Value:LastItemSubmitted.Site},ThisItem.Priority)  

     

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @OverRatedMelin 

    Thanks for your quick response and detailed description! Sorry for mu delay response due to weekend. 

     

    For your need , i test it in my side .And this is my test app:

    vyueyunmsft_0-1699838515892.jpeg

     

    Button-OnSelect:

    ClearCollect(LastItemSubmitted,{Site:Dropdown1.Selected.Value ,Unit:"Unit Test"});
    Set(DuplicateNCR,false);

     

    Duplicate-OnSelect:

    NewForm(Form1);
    Set(DuplicateNCR,true);

     

    Datacard-Default:

    If(DuplicateNCR,{Value:First( LastItemSubmitted.Site).Site },ThisItem.Priority)  

     

    I think the issue you need to check is the Value , here i am using the "First( LastItemSubmitted.Site).Site".

    Because the LastItemSubmitted.Site return a table type which will cause the issue. We need to make this return a Text type instead of the Table type :

    vyueyunmsft_1-1699838515894.jpeg

     

     

     

    Best Regards,

    Yueyun Zhang

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard