Hello. I am trying to configure a search bar that searches for a student ID number. I realize powerapps works well with strings and is a bit difficult with integers. If someone could help me out that would be great. I cannot give out the db name so for the sake of any example please just use 'database' and for the table simply use 'table'. The column name is StudentID.
Solved! Go to Solution.
@Anthony_Bellai ok, you can try this:
Filter('[dbo].[SOURCE]',Value(StudentID)=Value(TextSearchBox1.Text)
You might cause some delegation issues though..
If you share your error messge by hovering over the red underline in your formula I will see if there is a better solution.
Thanks,
Luke
Say search bar is named textinput1.text
In your gallery filter simple put:
Filter(Source,ID=value(Textinput1.Text)
I do this a lot but with more complexity in that I may also want Surname or First Name in the serach bar so I use
If(IsNumber(Textinput1.Text,Filter(Source,ID=value(Textinput1.Text),Filter(Source,Startswith(Surname,TextInput1.Text)||Startswith(FirstName,TextInput1.Text)))
@leyburn19 it looks like he is already doing that in his screenshot.
@Anthony_Bellai what is the data type of your studentid SQL Column? you might be comparing data with different types.
Thanks,
Luke
The student IDs are integers.
Filter('[dbo].[SOURCE]',StudentID=Value(TextSearchBox1.Text)
The values being compared aren't the same type.
@Anthony_Bellai ok, you can try this:
Filter('[dbo].[SOURCE]',Value(StudentID)=Value(TextSearchBox1.Text)
You might cause some delegation issues though..
If you share your error messge by hovering over the red underline in your formula I will see if there is a better solution.
Thanks,
Luke
This worked, or will work, unfortunately my dataset is much larger than 2000 rows but the formula is correct and will help me in the long run. Thank you very much, @Luke_Timmins !
User | Count |
---|---|
158 | |
93 | |
78 | |
73 | |
57 |
User | Count |
---|---|
202 | |
166 | |
98 | |
94 | |
79 |