cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stijn007
Advocate II
Advocate II

items of dropdown depending on other dropdown ( populated with data from another SPlist )

Hello ,

 

I have a form with 3 choice fields that have to be filled in. ) 

 

one for the line (eg   50 or 50A ) 

2 others with the location who are filtered by the first dropdown LINE 

 

I have a SPlist to populate the dropdowns. 

column LINE and column LOCATION( both text) 

 

I use a form and i cant get my items right for the second dropdown ( depending on the value in the first dropdown LINE ) 

Stijn007_0-1606998371743.png

 

6 REPLIES 6
RandyHayes
Super User
Super User

@Stijn007 

Can you share some of the formulas you have for the Items properties of the dropdowns that you are having problems with?

As long as you have a related column to filter on, you should be able to achieve this fairly easily.  For example:

Dropdown 2 Items : Filter(yourDataSource, lineColumn=Dropdown1.Selected.Value)  

Dropdown 3 Items: Filter(yourDataSource, lineColumn=Dropdown1.Selected.Value && FromColumn=Dropdown2.Selected.FromColumn)

 

Of course the "Value" in the above will need adjustment based on the Items properties you have in each.  Also, the names of the list and columns should be adjusted to fit your data.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

hello , 

 

the items  from the dropdown is from another list than the list where the "results" are stored. 

I have a sharepointlist (further named SPList A ) with 2 textcolumns. first column is for the line (further named as ColumnA) and second column ( further named as ColumnB ) 

In the form to create an item, this works fine. 

first dropdown ( Distinct( SPlistA ; ColumnnameA ) 

second dropdown ( Filter ( SPListA ; ColumnameA = datacardvalue.selected.RESULT).columnameB

thirth dropdown is the same as the second. can be ignored. 

 

Now in the editform: 

dropdown1 = Distinct(SPListA ; ColumnameA ) 

Second dropdown = Filter ( SPListA ; ColumnameA = Datacardvalue.selected.result). columnameB

works only when you select another item in first dropdown. It looks like the first dropdown is empty if you want to change the second dropdown in the editform. 

The list is empty. 

 

RandyHayes
Super User
Super User

@Stijn007 

So you have two forms for this?  Okay, so if you have a separate EditForm, then it sounds like your issue is that the first DropDown is not getting set by the underlying record value.

You need to set the defaults on the dropdowns to the underlying data value.  Otherwise they will all have incorrect values.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Stijn007
Advocate II
Advocate II

@RandyHayes , 

 

thanx for the tip, I tried everything on the default side but nothing works. 

which  value do i have to store for Defaults and which one at defaultselecteditems? 

 

 

RandyHayes
Super User
Super User

@Stijn007 

So you mention DefaultSelectedItems, this means you are using a ComboBoxes, not Dropdowns.  They are different.  If you are not needing search or multi-select capability, I would advise to use Dropdowns instead.

 

One important question - you mention that all of these are Text columns in your datasource (Line, To, From) but you also mention Choice in your original post.  Are these columns in fact Text columns?  If so, then continue reading, if not, then post back exactly what type of columns they are.

 

The easiest thing to do is this:

1) Remove the FROM and TO and cards from your EditForm.

2) Add the FROM and TO fields back in.

3) Change the Control type in the Field editor to "Allowed Values" for both fields

4) Unlock both datacards

5) Set the AllowedValues in the TO DataCard to the following:

RenameColumns(Distinct(SPListA ; ColumnameA); "Result; "Value")

6) Set the AllowedValues in the FROM DataCard to the following:

RenameColumns(
    Filter (SPListA ; ColumnameA = nameOfDropDownControlFromPreviousStep.Selected.Value).columnameB;
    "columnnameB";
    "Value"
)

 

At this point all the rest of the functionality (displaying the Edit record information and saving to your underlying column) will all work.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

I think I will change my form totally because i also have errors ( ETAG MISMATCH,...) 

What would be the easiest way? even i have to leave my form and start all ove again. 

 

I Have 2 comboboxes. ( users should be able to search ) 

items of the comboboxes are from  sharepointlist1. ( now 2 text columns ) 

Items property of the comboboxes:

 

Combobox1 = Sharepointlist1.textcolumn 1

Combobox2 =  Filter( Sharepointlist1 ; textcolumn1 = combobox1.selected.value').textcolumn2

 

On the onchange Property i would like to patch the new value to a column in another list. 

=> should i take a text column for this or a choice column? 

 

when one ore 2 fields are modified , I have a botton that activates a flow and send the new values.  

Here I have a problem that when I use "thisitem.columnOfSharepointlist2 " the new value is not correct. 

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,234)