0

Wrap a text in a Rich Formula field

Hi to all!

this formula :

 

let tracklist := response.result.tracklist;
let tracklistInfo := "";
for track in tracklist do
    let position := track.position;
    let title := track.title;
    let duration := track.duration;
    tracklistInfo := tracklistInfo + html(position + " - " + title + " - " + duration + "<br>")
end;
let xtracklist := tracklistInfo;
Tracklist := xtracklist

gives an output like this:

A1 - Chapter 24 - 3:36A2 - Mathilda Mother - 3:03A3 - Arnold Layne - 2:51A4 - Candy And A Currant Bun - 2:38A5 - The Scarecrow - 2:07B1 - Apples And Oranges - 3:01B2 - It Would Be So Nice - 3:39B3 - Paint Box - 3:27B4 - Julia Dream - 2:28B5 - See Emily Play - 2:50

 

my desired output would obviously be like this:

 

output:

A1 - Chapter 24 - 3:36
A2 - Mathilda Mother - 3:03
A3 - Arnold Layne - 2:51
A4 - Candy And A Currant Bun - 2:38
A5 - The Scarecrow - 2:07
B1 - Apples And Oranges - 3:01
B2 - It Would Be So Nice - 3:39
B3 - Paint Box - 3:27
B4 - Julia Dream - 2:28
B5 - See Emily Play - 2:50

 

Any suggestions on how to correct the formula?

3 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    You can use a join() function for this:

    let tracklist := response.result.tracklist;
    join(for p in range(0, cnt(tracklist)) do
        item(tracklist, p).position + " - " + item(tracklist, p).title + " - " + item(tracklist,p).duration
    end, "
    ")

    Note the 'Hard Return in. the last 2 lines of code.

      • francescostefanello
      • 1 yr ago
      • Reported - view

       

       

      let tracklist := response.result.tracklist;
      let xtracklist := join(for p in range(0, cnt(tracklist)) do
              item(tracklist, p).position + " - " + item(tracklist, p).title + " - " +
              item(tracklist, p).duration
          end, "
      ");
      Tracklist := xtracklist

       

      FANTASTIC. THANK YOU A LOT

    • francescostefanello
    • 1 yr ago
    • Reported - view

    edited in:

     

    let tracklist := response.result.tracklist;
    let xtracklist := join(for p in range(0, cnt(tracklist)) do
            item(tracklist, p).position + " - " + item(tracklist, p).title +
            (if item(tracklist, p).duration then " - " + item(tracklist, p).duration else "")
        end, "
    ");
    Tracklist := xtracklist

     

    if the duration is not present

Content aside

  • Status Answered
  • 1 yr agoLast active
  • 3Replies
  • 92Views
  • 2 Following