cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
agneum
Advocate IV
Advocate IV

Check if item exists in list of values


I'm looking for a fuction to replace the following psuedocode:

Exists(Textbox1.Text;
DropDown.Items)


//Returns true if textbox1.text is in the list of dropdown items.

EDIT: Made an edit to make the problem easier to explain.


 

15 REPLIES 15

Hi @agneum ,

I misunderstood your question - I will leave you with @eka24 

@WarrenBelz  I was just very unclear. What I could do is turn the list of countries into a collection and use the Filter + Count methods on it to determine if it's in the list. But was hoping I could use another control (and its items property where I have all the values it could have defined) as the source of the list to check against instead, if that makes sense.

I couldn't use dropdown.items as a datasource, so I suspect it's not possible to do.


Thanks for your help!

 

Hi @agneum ,

I also should have seen your level and realised you would have thought of the solution I posted.

I think you are on the right track.

If the idea is to limit calls to your database, create a collection and then use the collection as the dropdown list :

 

ClearCollect( Countries,    { City: "London",    Country: "United Kingdom"},    { City: "Berlin",    Country: "Germany"},    { City: "Madrid",    Country: "Spain"},    { City: "Hamburg",   Country: "Germany"},    { City: "Barcelona", Country: "Spain"},    { City: "Munich",    Country: "Germany"})

OR

ClearCollect (Countries,YourTableName) The use Countries as a list for the dropdown

 

Adding screen shot may help clarify issues.

Seems like a collection is the way to go. But since the dropdown is a lookup on a static table, it would be nice to somehow specify "this is the list of values this dropdown can be" directly in the property. 

 

eka24
Super User III
Super User III

Is that you want a massage to be Shown?
If you can explain further.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (48,745)