Hi.
In my list function for contacts, I have Group By: Company, and In-App Sort: Last name.
When I add a new contact, through my phone, it appears at the end of the list, by company. It is not sorting them by last name. Even if I close and relaunch after adding, the sort still isn’t working.
Also, when I add a new contact, I have in my Add Form Function “On Submit: Add Row” and it is adding new entries twice. Not sure why it’s adding twice.
TIA
Pete
Forms add rows already. That is their purpose. Adding an On Submit action to also add a row is redundant. That is why you get two rows.
When adding a contact, is the company an existing company? Is the contact at least falling into the correct group? Does it look correct in the builder? Can you show a screenshot of your sort settings? Also, have you forced closed and restarted the app on your phone since making the sort change?
2 Likes
Hi Jeff,
Thanks. I have removed the add on submit and it’s working fine, only adding once.
I am adding a contact to existing company. It does group correctly. I can’t see it in the builder, as I can’t scroll down past the first screen. I have attached a screenshot of what it looks in my phone, after I have closed and restarted. Mel Sim is the first addition of new contacts to the company.
I also included a screenshot of my settings for the list function in the builder.
The sort worked fine when I set it up. It’s when I add that’s the problem.
Appreciate the help.
You’re sorting by company. Shouldn’t that be by last name?
2 Likes
Keep in mind that if you filter by company group if the registered employee does not have a company help the employee will not be shown in the list
1 Like
@Darren_Murphy pointed out the exact problem. You are sorting your table by Company, so the companies are in alphabetical order, but all contacts within each company will be in sheet order. It probably looked fine initially because you probably had names in alphabetical order already. New rows are added to the end of the table, so the names are no longer in alphabetical order.
You can switch your sorting to use Last Name, which will place the names in alphabetical order within each company, but your company groups may no longer be in alphabetical order. What I would recommend doing is create a Template column that Joins Company Name, a ‘-’ dash, Last Name, a ‘-’ dash, and First Name. So you should end up with a column containing values like 'Company - Hager - Jeff'
. This template column is what you will use for sorting. This will sort by Company, followed by Last Name, followed by First Name.
@DillanMartinez also made a very good point. Names that don’t have a Company filled will not be displayed because you are using Grouping in your list…and no company means the name wouldn’t fit into any of the groups, so it won’t display. Make sure you are filling a company when you add a new contact, unless you want to have the option to not enter a company. In that case, I would maybe create an IF column that checks if Company is not empty. If it’s not empty, then return the company name. Else, if it is empty then return something like ‘none’. That way, you can use the IF column for your grouping and it will always have a value such as the company name or ‘none’.
4 Likes
All contacts have a company, so not worried about that.
What’s the point of in-app sort then? It seems like that should it. I want the companies and employees to be sorted by alpha. It should be much easier than appending a special combination of colums to then re-sort again.
There should be a + to add more than one sort, like there is in the in-app section.
Pete
Sorting works great for a lot of cases. Most of the time people only need to sort by one column. When you apply grouping on top of that, then it’s gets more complicated if you need the groups sorted as well as the rows within the group. If you were to sort by name only, then the names will be alphabetical, but the company groups will show up in the order that they found when reading through the sorted list of names.
I agree that ideally we would have the option to select multiple values to sort by, and I think Glide is currently considering that, but for now the only option is to create a template column if you want it to sort by multiple columns.
1 Like
Thanks, Jeff.
Do you know what the point of in-app sort is or how to invoke it, if it does do what it sounds like it should do, automatically?
In-App sorting provides an option for the end user to select which columns they want to sort by, and if they want accending or descending. It’s not automatic. It has nothing to do with the default sorting that you are trying to set. It’s for the end user.
You can learn about sorting in the documentation.