web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trying to create a qui...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 178

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!

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at

    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

  • v-yuxima-msft Profile Picture
    Microsoft Employee on at

    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 Profile Picture
    178 on at

    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

  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at

    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.

  • KProuty Profile Picture
    178 on at

    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?

  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at

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

  • KProuty Profile Picture
    178 on at

    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})

     

     

  • Verified answer
    Pstork1 Profile Picture
    69,397 Most Valuable Professional on at

    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.

  • KProuty Profile Picture
    178 on at

    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!!!!

  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at

    You are welcome.  Glad I could help.  Sorry it took so long.  I should have just prototyyped it from the beginning.  The syntax on when to use single quotes always causes issues.

     

    I hope the vets have a wonderful time in DC.  Its truly an amazing place to visit.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard