0

how to play with internal references ?

Hi there ninox forum,

I need some help please…

I'm modifying a table 1 that has a content in cell A

I've created a second table 2 that also has the same content in cell A

I've created a new cell B in table 1 and I want it to point to the cell A in table 2

Now I want to massive update table 1, so I want to copy cell A from table 1 to cell B in table 1 but not as a content but as a reference to cell A in table 2

I can't figure out the code to put in the massive update cell ?

Thanks from france

Laurent

3 replies

null
    • Laurent
    • 2 yrs ago
    • Reported - view

    i'm setting (with a maasive modification) cell b in table 1 to be :

    first(select 'table 2' where 'cell a' = 'table 1'.'cell a')

     

    but it's not working… what am i missing ???

    • Fred
    • 2 yrs ago
    • Reported - view

    Hi Laurent -

     

    try adding this to your code:

     

    let curRec := this;

    first(select 'table 2' where 'cell a' = curRec.'cell a')

     

    In Ninox "this" is a simple command to tell the software to gather data from the current record you are on. So you first put all the data of your current record in a variable, then you can call that data later in your formula. I thought you could use "this" by itself, but I tried it out and it doesn't work.

     

    Or you can be very specific in your variable:

     

    let curRec := this.'cell a';

     

    Then you would modify your select to be:

     

    first(select 'table 2' where 'cell a' = curRec)

     

    I find it more useful to use just "this" so curRec can be more useful if I have to use multiple fields. You can call curRec.'cell a' then call curRec.'cell b', etc.

    • Laurent
    • 2 yrs ago
    • Reported - view

    thanks fred !

    i was so close…

    i was stuck with :

    first(select 'table 2' where 'cell a' = table 1.curRec.'cell a')

    my mistake was to enter in the second part "table1." (i guess not possible once you have declared select table 2 in the first part…)

    first(select 'table 2' where 'cell a' = curRec.'cell a') is indeed the solution !!

    great thanks again fred

Content aside

  • 2 yrs agoLast active
  • 3Replies
  • 334Views