cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nergal
Regular Visitor

Automatic fill of Drop Down List

Dear friends

 

First I apologize for the mistakes in English, I am not a language speaker.

 

My question is as follows:

I have the form where the database comes from Excel. I would like to know if it is possible for a card to be filled automatically, depending on what was inserted by the user in the previous card.

 

Example:

On the first card, there is a drop-down list containing information about the name of my suppliers. On the second card, also in a drop-down list, there is information about the type of service provided.

I would like that, when selecting a supplier's name from the drop-down list, the "Type of service" card would be automatically filled in with the type of service she performs for me.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Nergal ,

Do you want to make a selection of supplier, other fields will all be automatic filled in?

I've figured out two solution for your reference:

1)set the form's Item based on the selection of supplier

In this solution, all other field will be automatic filled in when the form's Item change.

However, you need to put the drop down of supplier out of the form.

Or else it will lead to circle error.

Because all the field will be affected by the form's Item, including supplier field. While supplier field affect the value of the form's Item. It means that supplier field will affect itself value, which is called  circle error.

Step1:

insert a combo box outside the form (for supplier).

set the combo box's Items:

Distinct(table,suppliers)

Step2:

insert an edit form without supplier field

set the edit form's DefaultMode:

If(IsEmpty(Combo box.Selected),New,FormMode.Edit)

set the edit form's Item:

LookUp(table,suppliers=combo box.Selected.Result)

Then if you not select any supplier, the form will be empty and be used to create new record.

If you select any supplier, the form will be automatic filled in data and be used to edit existing record.

If you want to update with the value of the supplier, I suggest you use Patch() function.

363.PNG

 

 

2)set the controls datacards' Update one by one

In this solution, you could still put supplier combo box inside the form, but you need to set controls' Default value one by one.

Step1:

set supplier combo box Items:

Distinct(table,suppliers)

2)set other field's datacards' Default one by one

LookUp(table,supplier=ComboBox1.Selected.Result,fieldname)

//replace with table name and other field names

364.PNG

 365.PNG

 

//in this solution, the form will still be new mode, which is used to create a new record.

 

 

 

Best regards,

Phoebe

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.

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @Nergal ,

Can you please supply the names and Items property of both your DropDowns and also the name of the Excel data table.

When you refer to card, have you already made an New record form with these two filelds and you simply want these populated with the values from the DropDowns?

 

eka24
Super User
Super User

Very possible. Your English is very OK. For example after you have selected the dropdown, datacardvalue default could be set to this formula :
Dropdown.Selected.Value
This will pick the selected item into the datacardvalue automatically. More details would help.
v-yutliu-msft
Community Support
Community Support

Hi @Nergal ,

Do you want to automatic select a drop down based on the selection of another drop down and these two drop downs are in the same form?

Let me use "suppliers" and "Type of service" as example too.

Could you tell me

1)the data type of "suppliers" field and "Type of service"field?

2)do these two fields data come from the same table?

I assume that these two fields are all text type and come from same table.

Then try this:
1)set "suppliers" drop down's Items:

Distinct(table,suppliers)

//replace with your table name

set "suppliers" drop down's OnChange:

Reset(Type of service drop down)

 //replace with Type of service's drop down name

2)set Type of service's drop down Items:

Distinct(table,Type of service)

//replace with table name

set Type of service's drop down Default:

LookUp(table,suppliers=suppliers drop down.Selected.Result,Type of service)

//replace with suppliers drop down name, get the selected item's Type of service value.

 

Then if you make any selection in suppliers drop down, the Type of service drop down's selected value will change automatically.

 

 

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.
Nergal
Regular Visitor

Hello friends,

I am very grateful for the answers and I apologize, in fact I did not express myself so clearly, I hope to be clearer this time, I apologize, because as I do not have complete command of English, I have a little difficulty in expressing myself.

 

I have a table in excel with different data, of different types, date, numbers, texts. Regarding the service provision contracts signed between my company and our suppliers. Each supplier provides a specific type of service. Every month our sectors send to the financial department what services were performed, my idea is that this sending was done using PowerApps.

There are about 150 suppliers, I would like to build an application, where when filling in the name of the supplier on the first card, the other information would be automatically filled.

Example: In the first card, the user fills in the name of the supplier, and in the following cards, the value of the contract, type of service provided, end date of the contract, contract manager, among other information, was filled in automatically.

In Excel I can fill a cell and after that, the others fill in automatically, I wanted to do something similar in PowerApps.

Note: This information comes from a table, where my "general" database is Excel on OneDrive

Hi @Nergal ,

Do you want to make a selection of supplier, other fields will all be automatic filled in?

I've figured out two solution for your reference:

1)set the form's Item based on the selection of supplier

In this solution, all other field will be automatic filled in when the form's Item change.

However, you need to put the drop down of supplier out of the form.

Or else it will lead to circle error.

Because all the field will be affected by the form's Item, including supplier field. While supplier field affect the value of the form's Item. It means that supplier field will affect itself value, which is called  circle error.

Step1:

insert a combo box outside the form (for supplier).

set the combo box's Items:

Distinct(table,suppliers)

Step2:

insert an edit form without supplier field

set the edit form's DefaultMode:

If(IsEmpty(Combo box.Selected),New,FormMode.Edit)

set the edit form's Item:

LookUp(table,suppliers=combo box.Selected.Result)

Then if you not select any supplier, the form will be empty and be used to create new record.

If you select any supplier, the form will be automatic filled in data and be used to edit existing record.

If you want to update with the value of the supplier, I suggest you use Patch() function.

363.PNG

 

 

2)set the controls datacards' Update one by one

In this solution, you could still put supplier combo box inside the form, but you need to set controls' Default value one by one.

Step1:

set supplier combo box Items:

Distinct(table,suppliers)

2)set other field's datacards' Default one by one

LookUp(table,supplier=ComboBox1.Selected.Result,fieldname)

//replace with table name and other field names

364.PNG

 365.PNG

 

//in this solution, the form will still be new mode, which is used to create a new record.

 

 

 

Best regards,

Phoebe

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.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,879)