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 / Set combobox default v...
Power Apps
Answered

Set combobox default value based on a selected row of datatable

(0) ShareShare
ReportReport
Posted on by 33

Hi guys!

 

I am trying to create a copy function to create a new form submission.

The marked button should load a new form with some fields of the selected row. 

RaphaelMelo_0-1695994272753.png

 

The problem started when I tried to set the "email_solicitante" cell from the data table as the default value for the "Solicitante" combo box field.

RaphaelMelo_1-1695994595093.png

 

I'm using this as the data source for my combo.

 

Filter(Office365Users.SearchUserV2({searchTerm:DataCardValue17.SearchText}).value, Country="Brazil", "MyDomain.com" in Mail)

 

 

Categories:
  • AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @RaphaelMelo I think you need to set the DefaultSelectedItems property of the combo box this would just be something like: 

     

     

    If(!IsBlank(UserYouHaveSelect),UserYouHaveSelect.email_solicitante)

     

    This is very generic and would not work if you copy it over but this is the general idea for you if you can give me more information on what the table structure is like and which field is being selected I could give you a more specific answer.

     

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. Remember, you can accept more than one post as a solution. If the content was useful in other ways, please consider giving it Thumbs Up.


    Thanks
    Andrew

  • Verified answer
    RaphaelMelo Profile Picture
    33 on at

    Thanks for helping!
    this gives me a glimpse of how I should handle that.


    On the  "On Select" propriety of the copy button, I add a boolean variable to manage the copy activity.

    Set(Copy,true);
    ResetForm(Form_frmCtrl);NewForm(Form_frmCtrl);Set(varFormVisible, true);


    and on the combo box "DefaultSelectedItems" property I set it like this:

    If(Copy,
     //true
     If(!IsBlank(DataTable_frmCtrl.Selected),
     First(Filter(Office365Users.SearchUserV2({searchTerm:DataTable_frmCtrl.Selected.Email_Solicitante}).value, Country="Brazil", "MyDomain.com" in Mail))
     )
     //false
    )

     
    and to do the same with any other form field, I have to put a condition to check if the Copy value is "true", as an example for another text field on the form:

    If(Copy,
     //true
     If(!IsBlank(DataTable_frmCtrl.Selected),DataTable_frmCtrl.Selected.Ticket_ESS),
     
     //false
     ""
    )



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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard