Return Number Ranges

Hello, I have another problem which I would like some assistance. I solved this one in filemaker, and need to adapt from the solution.

I would like to allow the user to input a list of numerical IDs using ranges or lists. For example:

User Input text field: 101-105, 7-9

Would appear in an array as:
101
102
103
104
105
7
8
9

In filemaker, I parse the numbers, hyphens and commas, and loop through, generating the array.

This way I can lookup information about each of these items.
Thanks in advance, and Iā€™m loving my time here with Coda

Hi @Nick_Solyom,

Basically, you do the same in Coda:

Formula is:

thisRow.Ranges.Split(",")
  .FormulaMap(CurrentValue.Split("-"))
    .FormulaMap(CurrentValue.WithName(range, 
      Sequence(range.First().ToNumber(), range.Last().ToNumber())
      )
    )
  .ListCombine()
  .Sort()

I hope this helps.
Cheers!

2 Likes