Hi all,
Thanks ahead of time for your help. I've been trying to make a very simple app to learn the basics of MPAs, but I cant seem to be able to find a way to search through my data. I've already spent some time searching through other people's posts and despite implementing some changes I still am stuck.
As shown in the images attached, I have a search bar as a text input feeding into the Search() command for a Gallery. The current formula in my Items line for the gallery is the following:
Hi @chrislamb2012 ,
You cannot refer to column names dynamically unfortunately.
Hi @WarrenBelz,
Would you be willing to assist me with another issue attached to your Solution?
I am now trying to use a drop-down selection output as an input for the desired search column argument in the Search() function. The Drop Down options are pulling from a column in my dataset with the name "Title Column" which has the names of all my other Columns in it. I'll attach an image of the column incase its format is relevant. I know its not very elegant, but it gets the job done for now while I learn.
I've modified your line of code into the following:
Hi @chrislamb2012 ,
Excel is a terrible data source where code that should work simply does not and this is yet another example. It clearly did not respond to your query (it should have sent the list back as the query is not Delegable), so I used a With() statement to "do it manually" and load the entire table, then do the query entirely "locally". This will only work on record numbers up to your Data Row Limit (which you can increase to a maximum of 2,000). I suggest you migrate to SharePoint Lists if you have them available.
@WarrenBelz That worked perfectly, thank you!
Would you mind explaining the line a bit?
Hi @chrislamb2012 ,
How many records are in your Table - if under 500, try this for a test
With(
{_Data: Table3},
Search(
_Data,
SearchInput1.Text,
"PO Number"
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
hmm alright, maybe its my excel table then. Ill try reformatting it. Thanks again
I have a gallery and I use the same logic in gallery's Item property to filter orders as the user type and works without any issues.
Hi @WarrenBelz , I've tried your idea but unfortunately landed into a new issue. Now I cannot see the Gallery thats been moved as seen in my attached image. I tried messing around with some things and searching through multiple threads I found on google, but no dice.
EDIT: Scratch that, I was able to figure out the issue, but the search still reveals no results with partial or complete search terms. Any further ideas?
Any suggestions? Thanks for your help
Hi @stum, Unfortunately this did not change anything, as the search does not reveal any results with Partial or Complete PO Numbers. Is there anything else you'd reccomend?
Instead of Search function you can use Filter function in Items property of your gallery. This will dynamically filter results in gallery.
Filter(
'Table 3',
StartsWith(
'PO Number',
SearchInput1.Text
)
)
And for additional columns you can expand the formula like this.
Filter(
'Table 3',
StartsWith(
'PO Number',
SearchInput1.Text
) && CustomerNumber.Value = CustomerNumberDropdown.Selected.Value
)
WarrenBelz
89
Most Valuable Professional
MS.Ragavendar
60
stampcoin
48