0

select inside "do as database" seems not to work with "let me := this" - or am I doing it wrong?

 Hi out there,

 

I'm trying to get a script running (ninox 3.12.8 docker), links between the current table and "Bilderdatenbank" do exist:

let me := this;
let bilderEmbed := [{}][false];
let dummyBilder := do as database Bilderdatenbank
        let mangelBilder := (select Bilder where Mangel = me);
        let helperArray := [{}][false];
        for bild in mangelBilder do
            let embedJson := [{
                        Bild: {
                            _type: "imageBase64",
                            format: "image/jpeg",
                            width: 200,
                            height: 200,
                            source: loadFileAsBase64(bild.Bild)
                        }
                    }];
            helperArray := array(helperArray, embedJson)
        end;
        helperArray
    end;
bilderEmbed := array(bilderEmbed, dummyBilder);

 

"me" is a record with Nr 186. The database "Bilderdatenbank" just holds a table "Bilder". The variable "mangelBilder" is always empty. If I modify line 4 like this, it works fine:

let mangelBilder := (select Bilder where Mangel = 186);

 

Could someone please point me in the right direction?

 

Thanks in advance!

1 reply

null
    • squared_GmbH
    • 3 mths ago
    • Reported - view

    great! while typing the question I saw a solution:

     

    add this before line 4 and change line 5:

    let mangelSource := number(me);
    let mangelBilder := (select Bilder where Mangel = mangelSource );
    

Content aside

  • Status Answered
  • 3 mths agoLast active
  • 1Replies
  • 27Views
  • 1 Following