0

How can I add additional fields to the returned array?

I want to add a newline character after each comma in an array.

For example, Original code.πŸ‘‡

for loop in select Customers do
    loop.'Customer information'
end

Returns Value.πŸ‘‡

 


[116.3219065673952,39.65193959022936,'M82F+C7F, Jingkai Side Rd, Da Xing Qu, Bei Jing Shi, China, 102601'],[116.56897422188871,39.760379224871365,'QH69+5H Tongzhou, Beijing, China']....


add a newline.πŸ‘‡


[116.3219065673952,39.65193959022936,'M82F+C7F, Jingkai Side Rd, Da Xing Qu, Bei Jing Shi, China, 102601'],

[116.56897422188871,39.760379224871365,'QH69+5H Tongzhou, Beijing, China'],

.....


3 replies

null
    • Fred
    • 4 mths ago
    • Reported - view

    Do you want to add a new line or a new field?

    If you want to add a new line, I politely ask, why? I would recommend you don't mess with how arrays look as they are formatted in a way that Ninox can recognize when items start and stop.

      • gold_cat
      • 4 mths ago
      • Reported - view

       hi,fred.

      Recently, I've been studying map annotations, and I've already tried connecting several map data to Ninox.... Speaking of which, I finally found this map (the second one in the MAP table), and after multiple failed attempts, I realized that the problem was the strict data format requirements. That's why I had this question...

      First, I created an equation in the Customers table,

      "[" +
      join([text(longitude(Location)), text(latitude(Location)), "'" + text(Location) + "'"], ",") +
      "]"

      Then I created  equation in the map table

      for loop in select Customers do loop.'Customer information' end

      Finally, I imported the map HTML.....

       

      [116.13307189941406,39.75385284423828,'δΈ­ε›½εŒ—δΊ¬εΈ‚εŒ—δΊ¬'],[116.3219065673952,39.65193959022936,'M82F+C7F, Jingkai Side Rd, Da Xing Qu, Bei Jing Shi, China, 102601'],[116.56897422188871,39.760379224871365,'QH69+5H Tongzhou, Beijing, China']....

      However, we need to add a newline character after each group in these arrays.
      which might be a bit clumsy, but I'm trying to find a way to solve the problem.So in the end, I got this group of arrays without line breaks, and that's where I returned to my original problem...

    • gold_cat
    • 4 mths ago
    • Reported - view
    for loop in select Customers do
        "
    "+loop.'Customer information'
    end

    Done!

Content aside

  • Status Answered
  • 4 mths agoLast active
  • 3Replies
  • 60Views
  • 2 Following