May 15, 2020 10:03 AM
I am doing a rollup on a field that has text (2-letter US State):
ARRAYJOIN(ARRAYUNIQUE(values),"\n")
I am wondering if there is any way to alphabetize the result output?
May 15, 2020 11:10 AM
If you sort the primary field alphabetically, will the US states be also alphabetized? If so, you can run the batch update block on the linked record field to sort the linked records alphabetically. Then the rollup values should be sorted the same as the linked records.
Nov 17, 2021 06:44 PM
I am also looking for this feature
May 05, 2022 09:37 AM
I don’t understand how to sort the primary field alphabetically or how to run the batch update block on the linked record field.
May 05, 2022 10:01 AM
May 05, 2022 10:27 AM
Here’s some background. I have a table called Guests and each record has a field called Last Name. But, the Last Name field is calculated with a formula.
In another table called Episodes, every record has a field called All Guests with a Rollup formula that collects all of the Last Names from the Guest records mentioned above.
Here’s the Rollup Formula: SUBSTITUTE(ARRAYJOIN(values), “,”, “-”).
Result: Yakov-Ben-Levy
Desired Result: Ben-Levy-Yakov
I want the 3 names to be in alphabetical order. Can the Batch Update App help with that? I assume it will not work on theLast Name field in the Guests table.
May 05, 2022 02:20 PM
Formulas and rollups cannot sort. Batch Update will only sort linked records by the primary field. Since the last name is probably not the primary field Batch Update probably won’t help you. The order of values in rollups matches the order of linked record fields.
By the way, here is a simpler rollup formula. Does the same thing, but just a little simper.
ARRAYJOIN(values, "-")
May 06, 2022 11:15 AM
Thanks for the simpler version.
You said:
The order of values in rollups matches the order of linked record fields.
How do I change the order of the linked record fields? I know how to sort in a table view, but this is something different, right?
May 06, 2022 11:50 AM
Yes, this is different.
You can open the linked record field cell and drag-and-drop the linked records to rearrange the order.
You can use scripting to rearrange the order.
You can use Batch Update to re-order by primary field value.
I also write an app for the Marketplace for sorting linked records. However it is still in review at the moment.
May 10, 2022 06:27 AM
Is your app available in beta? When do you think it will be released?
Also, how do I get started writing a script to re-arrange the order in the All Guests field?