cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mike17
New Member

Dynamically populate picklist

Hi,

 

I have a form with two picklists. Picklist 1 is a list of vendors and picklist 2 is a list of purchase order numbers. The "Item" property for these fields is as follows:

 

Choices([@Invoices].'Vendor Name')

Choices([@Invoices].'PO Number')

 

What I would like to happen is that having selected the desired vendor in the first dropdown, the options present in the second dropdown should be limited to only those PO numbers associated with the selected vendor, instead of all the PO numbers in the table. Is this possible? I am working in Dataverse for Teams.

 

Many thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Mike17,

Do you want to filter a dropdown based on another dropdown selected?

Could you please tell me that if the Picklist 1 and picklist 2 are corresponding to the 'Vendor Name' and 'PO Number' in the same list named 'Invoices'?

I hope that you would like to share the formula with us, however, I will give you a solution just based on my scenario.

2 Choice column as below.

v-qiaqi-msft_0-1618557632336.png

Set the Items property of the Dropdown corresponding to 'PO Number' as below:

 

ForAll(
    Filter(
        Invoices,
        'Vendor Name'.Value = DataCardValue10.Selected.Value
    ).'PO Number',
    'PO Number'
)

 

Note that the DataCardValue10 represents the Dropdown corresponding to 'PO Number'.

Regards,

Qi

 

Best Regards,
Qi

View solution in original post

8 REPLIES 8
Ethan_R
Continued Contributor
Continued Contributor

Hi @Mike17 ,

Here's a YT Link by Reza Dorrani. 

He has explained Cascading Dropdown which might help you in this scanario.

Hope this helps.

v-qiaqi-msft
Community Support
Community Support

Hi @Mike17,

Do you want to filter a dropdown based on another dropdown selected?

Could you please tell me that if the Picklist 1 and picklist 2 are corresponding to the 'Vendor Name' and 'PO Number' in the same list named 'Invoices'?

I hope that you would like to share the formula with us, however, I will give you a solution just based on my scenario.

2 Choice column as below.

v-qiaqi-msft_0-1618557632336.png

Set the Items property of the Dropdown corresponding to 'PO Number' as below:

 

ForAll(
    Filter(
        Invoices,
        'Vendor Name'.Value = DataCardValue10.Selected.Value
    ).'PO Number',
    'PO Number'
)

 

Note that the DataCardValue10 represents the Dropdown corresponding to 'PO Number'.

Regards,

Qi

 

Best Regards,
Qi

View solution in original post

Thanks! I'll take a look

 

Thanks for the suggestion, I'll try this out. The only difference in my scenario is that the two fields concerned are both present in a database table rather than a list but basically yes this is exactly what I need to do

HI @Mike17 ,

You just need this

Filter(
   Invoices,
   'Vendor Name' = YourFirstDDName.Selected.Value,
).'PO Number'

but another thing you might consider is on the OnChange of the first drop-down, reset the second

Reset(YourSecondDDName)

 

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. If the content was useful in other ways, please consider giving it Thumbs Up.

 

WarrenBelz
Super User
Super User

Hi @Mike17 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @WarrenBelz  - sorry for the delay in responding, I'm still seeing error messages with all of the suggestions so far and I'm not sure why. As soon as I get chance I'll repost with some screenshots and further details - thanks for your help, much appreciated! 

Mike17
New Member

So I decided to create some dummy tables and test page to make it simpler. As per the attached screenshots I have a table called Suppliers with 2 suppliers in it. I also have a table called INVS with 3 invoice numbers for both of the suppliers. I have a test page with a dropdown (ComboBox4) attached to the Suppliers table which correctly lists the 2 suppliers. I have another dropdown (ComboBox5) where the "Items" property is set to :

 

Filter(
INVS,
'Supplier' = ComboBox4.Selected.Value
).'InvoiceID'

 

So the idea is that having selected one of the suppliers in the first combobox, the second combobox should only show the invoice numbers associated with that supplier. 

 

As shown in the screenshot however this is erroring. I've been round the block trying different ways of doing this but always getting errors. I have also set the onChange property on ComboBox4 as suggested and this has also not made any difference. I'm probably missing something very obvious I know but this is my first Power App and I'm stumped! Thanks in advance for any additional suggestions.

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,135)