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.
@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.
I have a table named "Programs" in a SQL server db and it is the datasource for a Listbox in PowerApps Canvas.
The listbox is an multi-select one and I was successful to save the select Program ID into the database under a concatenated string (for example: 538,539 - where 538 and 539 are the program ids and "," is the delimiter).
Now I want to retrieve the record and display it on a Detail screen but instead of IDs in the database, I want to display the Program's names. If there is one program selected, I know I can use the following code
Filter('[dbo].[ProgramCodes]', ProgramID = ThisItem.ProgramID).ProgramName
but the issue is this listbox is the multi-select one and I can have more than 1 program selected. How can I do that?
Also tried: Filter('[dbo].[ProgramCodes]', ProgramID in Split(ThisItem.ProgramID, ",")).ProgramName but didn't work.
This is an old closed thread, can you please create a new one with your query.
If("Text" in DataCardValue.Selected.Value, true,false)
OR
If("Text" in Concat(ComboBox1.SelectedItems, Value&","),true)
User | Count |
---|---|
251 | |
102 | |
94 | |
48 | |
37 |