cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amemartinez
Helper II
Helper II

Data Type Question

Good Morning, I am very new to Power Apps. How do I fix a Enum data type? I am trying to enter in State into a dropdown input so that users can filter on State.

1 ACCEPTED SOLUTION

Accepted Solutions
Mink21
Resolver II
Resolver II

Could you try writting it like this?
Choices(TransportationProviders.State)

View solution in original post

8 REPLIES 8
Mink21
Resolver II
Resolver II

Hi @amemartinez 

 

You can either hardcode the values like this ["a","b","c"] in the items propiety of your dropdown, or you can set this same values in a variable so you can reuse them later.

To set them in a variable you should do it like this:
Set(NameOfVariable, ["a","b","c"])

 

I hope this helps!

Thank you. I was hoping to not have to hard code it as I would have to enter in all 50 states individually but if that is the only way then I will do it.

Mink21
Resolver II
Resolver II

You can also obtain the information from an external table (a SharePoint list for example) and connect your App to it.

It's pretty easy to create a SharePoint list from an Excel table, you'd avoid having to hard code every state

My data source is a sharepoint list and State column is a choice type. I am trying to add a dropdown in my gallery but keep getting the Enum as the Data Type and when I try to enter in state it always shows State( 

For example when I did Choices(TransportationProviders, State) it did Choices(TransportationProviders, State(

Again I am very very new to this as in this is my first app and first time using Powerapps.

Mink21
Resolver II
Resolver II

Could you try writting it like this?
Choices(TransportationProviders.State)

OMGOSH THANK YOU SO MUCH!!!! One more question if I wanted the box to be blank like nothing in the box until something was selected how would I do that?

Mink21
Resolver II
Resolver II

Dropdowns have a propiety called AllowEmptySelection, you just have to change it to 'true'.

I also recommend setting the Default propiety to blank

So now I want our reps to be able to filter on state (choice field) and then on county (text field) and then on zip code (text field) to narrow down the sharepoint list. My formula doesn't look right though. This is what I have:

Search(
Search(
Filter(
TransportationProviders,State = cbStateFilter.Selected.Value),
txtCountyFilter.Text,
"County"
),
txtZipCodeFilter.Text,
"ZIP"
)

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,306)