Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

shortening a list

Featured Replies

for want of a better way to describe it.

Can someone find a good solution to this problem?

The values contained in a field in a related table might look something like this, if listed:

1 2 3 4 7 9 10 11 12

I want this:

1-4, 7, 9-12

I have actually succeeded, using a looping script and a calculation field, but the calculation is very cumbersome. Also I wonder if it couldn't be done without a script - just with a calculation.

Any ideas?

Thanks in advance!

Hi

you'll need a custom function or a calculation involving a repeating field.

How many values can hold that list ?

You would proabably need the the following functions

List() - returns a delimited list of related values

ValueCount() - gets the total number of values in a list

GetValue() - gets a specific value

You could use all these together and accomplish what you are looking for.

Let(

[

numberCount = List(relatedField);

middle = floor(numberCount/2) // get the middle and round down... you could round up with upper

];

// would need to create a recursive function here to display values from 1 to middle - 1

// then display middle

// then use that same recursive function here to display the rest

)

This is of course assumes you have one value per related record. It's a little complicated. I can probably put something together for you a little later or someone else may come along and finish it out for you.

  • Author

raybaudi: the list can be long or very short. Anything is possible.

There is only one value per related record, but not a fixed number of related records.

I'd be very grateful if a solution could be found that doesn't use a script. I needed the script to create the groups of consecutive numbers but I really hate to have to make the user push a button to get the result.

... the list can be long...

More than 10000 values ?

  • Author

no! Probably never more than perhaps 40 values.

See if this helps:

http://www.briandunning.com/cf/734

Hi comment

I was waiting for you on this post :

P.S.:P there is the same problem that I had with situation like this:

1

2

3

4

6

7

The CF returns this result: 1 to 4, 6, 7, :

What else should it return?

For me it must return: 1 to 4, 6 to 7

( and surely not a final ¶ )

Mhm. I don't see it that way. To me, the "to" is a placeholder for SKIPPED values - and nothing is skipped between 6 and 7.

I might consider getting rid of the trailing ¶ in the premium version of the function. :

To me, the "to" is a placeholder for SKIPPED values

Yes, this is in fact an opinion matter :

BTW: if the premium version could evaluate also my opinion... :P

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.