0

create an array with a multiple values

Hi. How can I create an array containing the outgoing values of a loop for?

7 replies

null
    • Birger_H
    • 5 yrs ago
    • Reported - view

    Can you elaborate?

    Birger

    • Ninox developer
    • Fabio
    • 5 yrs ago
    • Reported - view

    Hi Birger.
    I want to have access at the position of my data ( maybe using item() ) who are saved in "myData" with the for loop:

    if I use this:

    ------------------------------
    let myData:=
    for i in ... do
    i
    end
    ------------------------------

    "myData" is automatically an array or I need a different code to read each 'i' value through its index?

    Thanks

    • Birger_H
    • 5 yrs ago
    • Reported - view

    "myData" in your example will be an array.

    Birger

    • Ninox developer
    • Fabio
    • 5 yrs ago
    • Reported - view

    Thanks

    • Max_Kondor
    • 3 yrs ago
    • Reported - view

    Is there a way to sort the arrays? For example based on a selection from the table?

    • CISOFT_Sarl
    • 3 yrs ago
    • Reported - view

    why not sort your selection before put them in a array?

    let myArrayDataSelectedSorted := for i in (select Invoice[Status=2] order by Amount) do

    i

    end

    • Sean
    • 3 yrs ago
    • Reported - view

    if you use then select statement, you don't need to use the for-loop. Otherwise, the approach Robert posted would be the one I would use. One more point, the sort order using that approach will be ascending so if you want the sort to be descending you can use the rsort() function on the variable the array was assigned to.

Content aside

  • 3 yrs agoLast active
  • 7Replies
  • 2894Views