cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Dropdown disappears during edit

Hello,  Not sure if this was raised here already but I still cannot figure this out and I have also searched a lot for this but still found no answer: I have a dropdown = MainCategory which looks up from a sharepoint list so this is automatically populated based on a combo box selection which is the NameEmployee. However, when I click Edit, it does not remember the initial choice and is showing blank. I would want it to remember the initial entry.

This is the formula of MainCategory dropdown:

ITEMS: Sort(Distinct(Filter('Master Employee',NameEmployee=ComboBoxEmpName.Selected.Result),Category),Result) DEFAULT: ThisItem.MainCategory

Photo A: Initial entry is automatically populated based on the choice in the previous combo box

sample1.JPG

 

Photo B: In detail screen, it is showing and then I click on the Edit button

sample2.JPG

 

Photo C: So when I click on the Edit button, the dropdown is not showing Factory anymore. It is blank. The idea is that users may be able to edit

sample3.JPG

 

thanks in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi@CatPagulayan,

Could you please tell me how you set the Items and DefaultSelectedItems property of the Combo Box?

I think the key is how you set the Items property of the Combo Box. If you use the Distinct() function, the DefaultSelectedItems should be set with something related to "Result".

In my scenario, I set the Items property of the Combo Box as below:

 

 

Distinct('Master Employee',NameEmployee)

 

 

Set the DefaultSelectedItems property of the Combo Box as below:

 

 

{Result:ThisItem.NameEmployee}

 

 

Set the Items property of the Dropdown as below:

 

 

Filter(
    [@'Master Employee'],
    NameEmployee = ComboBox1.Selected.Result
)

 

 

Set the Default property of the Dropdown as below:

 

 

LookUp(
        'Master Employee',
        NameEmployee = ComboBox1.Selected.Result,
        Category
    )

 

 

Note: Please do follow my workaround to check if it works.

111001GIF.gif

Hope it could solve the problem this time.

Best Regards,

Qi

View solution in original post

9 REPLIES 9
Community Support
Community Support

Hi@CatPagulayan,

Based on the issue that you mentioned, do you want to make the dropdown control corresponding to the MainCategory selected display when you edit?

Could you please share a bit more about the scenario:

  1. Is this MainCategory dropdown a Combo Box or a Dropdown, which determines which you need to set, the Default property, or the DefaultSelectedItems property?
  2. What is the column type of the NameEmployee, MainCategory, and Category, are they all Text columns?
  3. What is the relationship between the 'MainCategory' and 'Category'?

From the screenshots, I could not get why you use Distinct(xxx, Category) to filter the 'MainCategory'.

Please do answer the above questions.

Best Regards,

Qi

 

Hi @v-qiaqi-msft ,

To reply to your questions:
Based on the issue that you mentioned, do you want to make the dropdown control corresponding to the MainCategory selected display when you edit? - Yes. So what I would want is when I click on Edit, whatever is defined there initially (in my example - factory) should be automatically displayed as well and not blank.
Could you please share a bit more about the scenario:
Is this MainCategory dropdown a Combo Box or a Dropdown, which determines which you need to set, the Default property, or the DefaultSelectedItems property? - MainCategory is a Dropdown and not a combo box so the Default property is the one I set.
What is the column type of the NameEmployee, MainCategory, and Category, are they all Text columns? - NameEmployee is a combo box, MainCategory is a dropdown, Category is the name of the column in my Sharepoint list (which actually is the MainCategory. MainCategory is just the name of the dropdown, but the data is coming from a Sharepoint list where the column's name is Category)
What is the relationship between the 'MainCategory' and 'Category'? - they are the same. Category is just the column name in my sharepoint list while MainCategory is the name of my dropdown in PowerApps (the datacardkey name)
From the screenshots, I could not get why you use Distinct(xxx, Category) to filter the 'MainCategory'. - i use distinct because MainCategory information should show results based on NameEmployee which is a list of employee names in a sharepoint list.
Hope the above clarifies 🙂 let me know if you still have other questions. Thanks in advance for your help!

Community Support
Community Support

Hi@CatPagulayan,

Do you want to filter the Dropdown based on the Combo Box selected and make the Dropdown selected keep when editing?

Thanks for the response and your description do a big favor.

My bad for not describing what a column type is. This refers to the corresponding data type of the column in your data source, such as a Single line of text, Choice, Person, and so on.

Combine that with the formula you provided, I assume that the NameEmployee and Category are all Single-line-of-text column type.

The following is my scenario, you could check for reference.

category.png

Please try the following workaround.

Set the Items property of the Dropdown as below:

 

 

Distinct('Master Employee',Category)

 

 

Set the Default property of the Dropdown as below:

 

 

ThisItem.Category

 

 

Set the Update property of the Dropdown as below:

 

 

Dropdown1.Selected.Result

 

 

 Note: Please note that you should refer to the column name from your SP list directly rather than the control name.

Hope it could help.

Best Regards,

Qi

Hi @v-qiaqi-msft ,

My columns are single line of text. 

It is almost perfect 🙂 however, I have a cascading dropdown so whatever is in the Master employee selection, the Main Category dropdown should automatically show. In the case of what you have advised, all of the categories are showing and not just the category of the employee selected. Hope you can help, we are almost there 🙂

Community Support
Community Support

Hi@CatPagulayan,

Do you want to make the Dropdown populated with the only item based on the Combo Box selected?

If my understanding is correct this time, you just need to set the Items property of the Dropdown. There is no need to set the Default property of the Dropdown.

Set the Items property of the Dropdown as below:

 

[
    LookUp(
        'Master Employee',
        NameEmployee = ComboBoxEmpName.Selected.Result,
        Category
    )
]

 

Note: Please do remember the brackets "[" "]".

Hope we get there this time.

Best Regards,

Qi

 

Hi @v-qiaqi-msft ,

It is okay for new creation, but when I edit, again the dropdown doesn't show :(.

I made the Default of MainCategory dropdown as blank. 

Community Support
Community Support

Hi@CatPagulayan,

Could you please tell me how you set the Items and DefaultSelectedItems property of the Combo Box?

I think the key is how you set the Items property of the Combo Box. If you use the Distinct() function, the DefaultSelectedItems should be set with something related to "Result".

In my scenario, I set the Items property of the Combo Box as below:

 

 

Distinct('Master Employee',NameEmployee)

 

 

Set the DefaultSelectedItems property of the Combo Box as below:

 

 

{Result:ThisItem.NameEmployee}

 

 

Set the Items property of the Dropdown as below:

 

 

Filter(
    [@'Master Employee'],
    NameEmployee = ComboBox1.Selected.Result
)

 

 

Set the Default property of the Dropdown as below:

 

 

LookUp(
        'Master Employee',
        NameEmployee = ComboBox1.Selected.Result,
        Category
    )

 

 

Note: Please do follow my workaround to check if it works.

111001GIF.gif

Hope it could solve the problem this time.

Best Regards,

Qi

View solution in original post

Now this solved it!!! thank you @v-qiaqi-msft ! really appreciate you looking into this 🙂 🙂 🙂

Hi @v-qiaqi-msft ,

sorry but I ran into another problem.. seems your solution is applicable only if there is only 1 selection?

Because I tried it in this sample: this is my sharepoint list - single line of text still

ComboBoxADropDownB
YesYes
NoYes
NoNo

 

so my scenario is i choose ComboBoxA = Yes, DropDownB automatically becomes a Yes (this is ok and working fine)

but when I choose ComboBoxA = No, DropDownB only shows Yes. The idea is that I will be able to choose between yes or no.

If there is any way i can deal with that, again, considering that what I will be choosing initially will be reflected even if I click Edit. Combo box or dropdown does not matter as long as I get the result 🙂

thanks in advance!

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (38,918)