1

Loop not clear

Hi there,

Although loops are explained in your manual, it is not yet clear how you would, for example, in a table called "contacts" with only "firstname" and "lastname" but where some firstnames are missing (empty), fill in the missing information with "Norbert" ?  

Thanks for your help

3 replies

null
    • Fred
    • 1 yr ago
    • Reported - view

    Yeah the manual is not very good. 

    You can try something like:

    let loop1 in select contacts[firstnames = null] do
    loop1.firstnames := "Norbert"
    end
    

    or if you have your select in a variable already you can do:

    let x := select contacts
    let loop1 in x[firstnames = null] do
    loop1.firstnames := "Norbert"
    end
    
    • Chris
    • 1 yr ago
    • Reported - view

    Thank you Fred for your answer but I cannot make it work ...

    It seems that "let loop1 in" ... where "in" is not digestible ... is the issue.

    There is no hurry but I would love to make it work !

    • Fred
    • 1 yr ago
    • Reported - view

    oops, it should be:

    for loop1 in select contacts[firstnames = null] do
    loop1.firstnames := "Norbert"
    end
    

    typing too quick for my brain to follow.

    it is a for loop so I need to put a for in the beginning. :)

Content aside

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