cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

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

Advocate V
Advocate V

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.

Highlighted
Advocate V
Advocate V

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

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

Highlighted
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

Highlighted
Advocate V
Advocate V

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,615)