cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ZachyV
Level 8

Populating a Data Table based on Selection of value in dropdown control

I have a table called AOCSUPPORT and I created  6 views based on this table filtered by column Territory. Territory

has 6 entries - 1,2,3,4,5,6.

 

Depending the selection  number of the Territory value in the droipdown, I would like to call the view pertaining to that-

for example value 6 will display Territory 6 view and so on.

 

Having mentioned this, Can I just use the table AOCSUPPORT and filter the table based on the parameter passed in the

Dropdown control?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Anonymous
Not applicable

Re: Populating a Data Table based on Selection of value in dropdown control

Hi @ZachyV

 

Yes you can.

 

Not sure if you need the 6 SQL Views though as you can just do Filter()

 

Put one of those to your DataTable.Items

 

With Filter()

 

Filter(
  '[dbo.AOCSUPPORT]',Teritory=Dropdown.Selected.Item
)

 

With SQL Views

 

Switch(
  Dropdown1.Selected.Value,
  1,'[dbo.View1]',
2,'[dbo.View2]',
3,'[dbo.View3]',
  4,'[dbo.View4]',
  5,'[dbo.View5]',
  6,'[dbo.View6]',
)

 

View solution in original post

5 REPLIES 5
Highlighted
Anonymous
Not applicable

Re: Populating a Data Table based on Selection of value in dropdown control

Hi @ZachyV

 

Yes you can.

 

Not sure if you need the 6 SQL Views though as you can just do Filter()

 

Put one of those to your DataTable.Items

 

With Filter()

 

Filter(
  '[dbo.AOCSUPPORT]',Teritory=Dropdown.Selected.Item
)

 

With SQL Views

 

Switch(
  Dropdown1.Selected.Value,
  1,'[dbo.View1]',
2,'[dbo.View2]',
3,'[dbo.View3]',
  4,'[dbo.View4]',
  5,'[dbo.View5]',
  6,'[dbo.View6]',
)

 

View solution in original post

ZachyV
Level 8

Re: Populating a Data Table based on Selection of value in dropdown control

I think the dropdown value has to be enclosed with ' ' because it is a text or char data type.

ZachyV
Level 8

Re: Populating a Data Table based on Selection of value in dropdown control

It has to be Selected.value and I got it! thanks

Anonymous
Not applicable

Re: Populating a Data Table based on Selection of value in dropdown control

@ZachyV

 

If you data source is number type use:

Value(Dropdown.Selected.Value)

This will transform Text into Number type.

 

EDIT: Yes sorry its Dropdown.Selected.Value and not Dropdown.Selected.Item

ZachyV
Level 8

Re: Populating a Data Table based on Selection of value in dropdown control

1) If I wanted to left align the Field names in the dropdown and I could not find the property, what would it be?

 

2) Now that I got it displayed, it is possible to click a row in data table result  and navigate to another screen , I would say a Detail screen for that row?

 

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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