cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Help with using value of combobox

Hello,

 

We have a form for registry of employees, you can either enter new employees or see existing ones and edit, the connection is to an SQL server. We were using comboboxes for the Department, Sub-department and possible bosses of those Departments, we have no trouble when we are creating a new employee, because we filter the values with combobox.selected.value which, being a new employee, we did select the values in the previous comboboxes. The problem is that when we want to modify an existing employee and, for example, we want to change the sub-department, the combobox for that field won't show anything because we didn't select the Department combobox, it has its default value from the first time we enter it. In the end, we can just select the Department again and then the Sub Department and then the possible boss but that is tedious so we would really want to avoid it. We can use a dropdown but we may have to use another Lookup which we avoided with the combobox and that impacts the speed of the app.

 

TIA

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Help with using value of combobox

Hi @SCabrera98 ,

Do you mean that if you want to edit an existing record, the combo box will not display its original data?

Could you show me the formulas in Edit form's Item, this field's data card's Default, the combo box's DefaultSelectedItems?

What's more, when you edit the existing record, have you set the form's mode to edit?

If the form's mode is new, it will display no value.

Only if its mode is edit, it will display the record of the existing record.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Help with using value of combobox

Hi @v-yutliu-msft ,

 

My bad, I'll explain it better. 

Those 3 fields I mentioned, Department, Sub-Department and Boss, need to be selected in order, Sub-Department is filtered by the value you selected in the Department combobox, and Boss is filtered by the value you selected in the Sub-Department combobox.

The problem for us, is that when we want to edit an existing employee, if I just wanted to edit the employee's boss but nothing else, the combobox won't display the options of the bosses until I select the Department and the Sub-Department again, it does display the default value, but to display the options we have to click on the other fields again because the values have yet to be selected. 

 

The formula for the Items in the Sub-Department combobox is this one:

Filter('Table for Sub-Department]',ID_Departament=ComboBox2.Selected.ID_Departament)

 

Combobox2 is the Department Combobox.  

 

And the formula for the DefaultSelectedItems in the Sub-Department combobox is:

{Value:LookUp('[Table for Sub-Department]',ID_Sub-Department=Parent.Default,Sub-Department)}

 

Also, the Default Mode for the form is Edit, it goes to new when we click on the button to add new employees.

 

If you need more info I'll share it, thanks for your help!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,388)