cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MaxWendorff
Level: Powered On

Text input to search a gallery?

Hi, I have a screen in my app that groups certain data into a gallery. The data comes from a sharepoint list. Essentially there is a Work Order Number that has a location and a part number for someone to scan. Each work order has 3-7 different locations and part numbers which is why I grouped them into a gallery called "WorkOrderGallery" 

 

Everything Works except there are 300 different work orders and I need to be able to search the gallery based on the work order number. I can not get it to work with the current GroupBy code which is:

 

GroupBy(WorkOrder,"BASE_ID","WorkOrderDetail")

 

Is there a way I can nest a search function in here and set it to a text box?? Below are pictures of how the gallery looks and how it looks in tree format. Any help would be appreciated!

TreeView.PNG

 

GalleryView.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Text input to search a gallery?

@MaxWendorff 

No, none of those should be a factor in this.

I assume that this formula is the Items property formula for the WorkOrderGallery control.

I'm going to surmise that the work order number is in a Column called BASE_ID in your SharePoint list.

 

To summarize:

You have a Text Input control on your screen called TextWorkOrder

Your SubGallery items property should be set to : ThisItem.WorkOrderDetail

Your WorkOrderGallery items property should be set to: GroupBy(Filter(WorkOrder, StartsWith(BASE_ID, TextWorkOrder.Text)), "BASE_ID", "WorkOrderDetail") (by the way...sorry I had a missing parenthesis in my original formula)

 

Let me know if the above is all true and if not and you correct it, if you are seeing the results you want.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

8 REPLIES 8
Super User
Super User

Re: Text input to search a gallery?

@MaxWendorff 

 

Do you have a specific text input control for searching?  If not, you'll want to have something where you can enter the WorkOrder number - let's call it TextWorkOrder for now.

 

If that is the case, then you can modify your formula to the following:

GroupBy(Filter(WorkOrder, StartsWith(WorkOrderNumber, TextWorkOrder.Text),"BASE_ID","WorkOrderDetail")

This will filter the Gallery based on the work order number you enter in the text box.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
MaxWendorff
Level: Powered On

Re: Text input to search a gallery?

Thank you so much for your response!

 

I plugged that in and it all makes sesne but I get this error here:

 

..StartsWith(WorkOrderNumber, TextWorkOrder.Text)

 

It says its looking for a text value not a control. The value that it is referenceing is a label that is set to the Work Order Numbers so I am unsure as to why it is not working. Any Ideas?

Super User
Super User

Re: Text input to search a gallery?

@MaxWendorff 

Yes, that was a "generic" name.  You didn't mention the names of your columns in SharePoint, so I went with the logical name.

Replace that WorkOrderNumber with whatever the column name is in your list.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
MaxWendorff
Level: Powered On

Re: Text input to search a gallery?

I replaced it and I received no error messege! However, when I load up the screen the gallery loads as usual but when I type in the search box, all the data goes away. When I delete what I put in the search box, the gallery loads in as normal. Any idea?

Super User
Super User

Re: Text input to search a gallery?

@MaxWendorff 

What are you typing into your text box?  From your Photo, it should be something like "WO-09563"

This formula uses the StartsWith to find information that starts with the information in the textbox.  It is not a search function, so make sure you are putting in the correct accurate work order number.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
MaxWendorff
Level: Powered On

Re: Text input to search a gallery?

Yes I am making sure the data is accurate, could it be an issue with my sub gallery? It also holds labels with information from sharepoint collums. Otherwise could it be the size of the gallery as there are about 300 different work orders loading in?

Super User
Super User

Re: Text input to search a gallery?

@MaxWendorff 

No, none of those should be a factor in this.

I assume that this formula is the Items property formula for the WorkOrderGallery control.

I'm going to surmise that the work order number is in a Column called BASE_ID in your SharePoint list.

 

To summarize:

You have a Text Input control on your screen called TextWorkOrder

Your SubGallery items property should be set to : ThisItem.WorkOrderDetail

Your WorkOrderGallery items property should be set to: GroupBy(Filter(WorkOrder, StartsWith(BASE_ID, TextWorkOrder.Text)), "BASE_ID", "WorkOrderDetail") (by the way...sorry I had a missing parenthesis in my original formula)

 

Let me know if the above is all true and if not and you correct it, if you are seeing the results you want.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

MaxWendorff
Level: Powered On

Re: Text input to search a gallery?

NEVERMIND! I accidently had "" around the collumn name lol! Thank you so much! I appreciate all the help I could not have got it without it! Cheers

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,135)