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

Trying to create a quick app but having trouble with the search box/offline access

I haven't made an app in months/years... plus, I'm not a programmer, I'm a power user. Syntax isn't my strong suit, obviously.

 

I am making a quick app for our case managers to bring to Washington DC when they bring Veterans to see the memorials. The app will have their pertinent info, emergency info, picture. It connects to a Sharepoint list.

 

I have filtered the data to NOT include veterans from the list who were not approved for travel, but my search  box doesn't work anymore.

 

This works to scroll through the vets but nothing happens if I type in the search box.

 

SortByColumns(Filter('Roll 2019 Veterans', StartsWith("Contact1_x0020_First_x0020_Name", TextSearchBox1.Text)
&& TravelApproved), "Contact1_x0020_First_x0020_Name", If(SortDescending1, Descending, Ascending))

 

And this is my lame attempt to add in search so if someone types a name in the box the corresponding records come up.

 

SortByColumns(Search(Filter('Roll 2019 Veterans', StartsWith("Contact1_x0020_First_x0020_Name", TextSearchBox1.Text)
&& TravelApproved), SearchTexInput.text,"Contact1_x0020_Last_x0020_Name", "Contact1_x0020_First_x0020_Name",) "Contact1_x0020_First_x0020_Name", If(SortDescending1, Descending, Ascending))

 

 

Also, is there any "easy" way to have data stored on their phone in case they don't have internet access? If they go to a museum, example, and need to access this without dragging around papers that could get lost?

 

Thanks so much! It has been a while since I've been in here!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Trying to create a quick app but having trouble with the search box/offline access

I'm assuming you are using the CDS database and I didn't take the time to prototype it there, but I did prototype it with a list to stop eyeballing the exact syntax.  Here's the Gallery Items value that works for me with search.

 

SortByColumns(Filter('Roll 2019 Veterans',TravelApproved And (StartsWith('Contact1 First Name', TextSearchBox1.Text) Or StartsWith('Contact1 Last Name', TextSearchBox1.Text)) ),"Phone1", If(SortDescending1, Descending, Ascending))

 

I'm not sure where in advanced you are seeing that formula for the text box or what you are trying to do with it.  But for a canvas app with a gallery and a text box the formula above shoule work.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

10 REPLIES 10
Dual Super User
Dual Super User

Re: Trying to create a quick app but having trouble with the search box/offline access

First, to add search to the function just forget about using the Search() method and add another clause to the Filter() method that matches against the Search Text box.  Something like this.

SortByColumns(Filter('Roll 2019 Veterans', StartsWith("Contact1_x0020_First_x0020_Name", TextSearchBox1.Text)
&& TravelApproved && (StartsWith("Contact1_x0020_Last_x0020_Name",SearchTexInput.text) || StartsWith("Contact1_x0020_First_x0020_Name",SearchTexInput.text) )), "Contact1_x0020_First_x0020_Name", If(SortDescending1, Descending, Ascending))

 

For Offline here's an article on using LoadData and SaveDate to create an offline data store.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/offline-apps



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: Trying to create a quick app but having trouble with the search box/offline access

Hi @KProuty ,

 

Do you test with @Pstork1 's suggestion?

And do you want to search by start with  FirstName and Travel Approved?

I suggest if you want to use start with these two columns you can add another search box as this:

20190514Search.PNG

 

More information:

function-filter-lookup

 

About offline,you can also reference @Pstork1 's suggestion offline-apps

 

Best Regards.

Yumia

KProuty
Level: Powered On

Re: Trying to create a quick app but having trouble with the search box/offline access

I tried your string, and I don't get an error except for the delegation error that I got with my previous string, which is OK because I have less than 500 items, however, no items populate the gallery with the string. When I use the string I put up, I get the vets in the gallery list, but I can't search on them.

 

I only have one search box (and I only want one), and if I type something in that search box and hit return, nothing happens. I want to be able to search by first and last name in the search box, but have the vets come up in alpha order by first name.

 

Not sure what is happenning with the extra filter versus the search.

 

Katherine

Dual Super User
Dual Super User

Re: Trying to create a quick app but having trouble with the search box/offline access

If you only have one text box then try this:

 

SortByColumns(Filter('Roll 2019 Veterans', (StartsWith("Contact1_x0020_First_x0020_Name", TextSearchBox1.Text) Or StartsWith("Contact1_x0020_Last_x0020_Name", TextSearchBox1.Text)) And TravelApproved), If(SortDescending1, Descending, Ascending))

 

That will use the seearch box text to search of a match either in the first name or last name fields.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
KProuty
Level: Powered On

Re: Trying to create a quick app but having trouble with the search box/offline access

I'm getting the specified column 'ascending' ascending does not exist or is an invalid sort type column. No items show in the gallery.

 

What is really weird that even with my original string, I can't even search on first name. Shouldn't I have been able to search on first name with that string?

 

Could it be something else that is wrong?

Dual Super User
Dual Super User

Re: Trying to create a quick app but having trouble with the search box/offline access

Sorry, so focused on the filter that I didn't see the SortByColumns.  use this and replace the Italic text with the name of the column its supposed to sort on.

 

SortByColumns(Filter('Roll 2019 Veterans', (StartsWith("Contact1_x0020_First_x0020_Name", TextSearchBox1.Text) Or StartsWith("Contact1_x0020_First_x0020_Name", TextSearchBox1.Text)) And TravelApproved),ColumntoSortBy, If(SortDescending1, Descending, Ascending))



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
KProuty
Level: Powered On

Re: Trying to create a quick app but having trouble with the search box/offline access

Now I just get the delegation error but nothing shows in the results if I type the name Bruce in the search box or one of the last names in the search box, and I know they are in the results.

 

It has to be something else?

 

When I click on TextSearchbox1 I have this in advanced:

 

Collect(Collection1, {Text: TextSearchBox1.Text})

 

 

Dual Super User
Dual Super User

Re: Trying to create a quick app but having trouble with the search box/offline access

I'm assuming you are using the CDS database and I didn't take the time to prototype it there, but I did prototype it with a list to stop eyeballing the exact syntax.  Here's the Gallery Items value that works for me with search.

 

SortByColumns(Filter('Roll 2019 Veterans',TravelApproved And (StartsWith('Contact1 First Name', TextSearchBox1.Text) Or StartsWith('Contact1 Last Name', TextSearchBox1.Text)) ),"Phone1", If(SortDescending1, Descending, Ascending))

 

I'm not sure where in advanced you are seeing that formula for the text box or what you are trying to do with it.  But for a canvas app with a gallery and a text box the formula above shoule work.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

KProuty
Level: Powered On

Re: Trying to create a quick app but having trouble with the search box/offline access

BINGO!!!!!

 

You ROCK!

 

Thank you thank you thank you!

 

I'm meeting with the travel group in a half hour to show them how wonderous this thing is and how it will help them, and with what you gave me right now, it is TRULY wonderous!

 

This trip is a trip of a lifetime for these vets!

 

Thank you!!!!

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,008)