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!
Solved! Go to Solution.
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.
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
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:
More information:
About offline,you can also reference @Pstork1 's suggestion offline-apps
Best Regards.
Yumia
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
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.
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?
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))
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})
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.
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!!!!
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
203 | |
187 | |
80 | |
50 | |
38 |
User | Count |
---|---|
303 | |
249 | |
123 | |
73 | |
55 |