0

Button that fills a table

Hi!

I have a blank T table with the following fields:

First. Text field

Second. Numeric field

I want to create a button (within the same table) that will create 10 records in table T by filling them like this:

First := random text

Second: serial number starting from the highest number already present in the table.

Can you help me?

Thank you!

3 replies

null
    • Fred
    • 2 yrs ago
    • Reported - view

    I have no idea how to create a random text generator. Maybe someone way smarter than me can figure it out. But for the record creation you try something like:

    let selAll := (select tableName);
    let mNum := max(selAll.Number);
    for loop1 in range(1, 11) do
        let newRec := (create tableName);
        newRec.(Number := mNum + loop1)
    end
    

    Line 1, puts the all of the record in the current table in a variable.

    Line 2, then pulls the max value from the field Number from all of the records in Line 1.

    Lines 3 - 6 is the for loop that creates 10 records.

    Line 5 is where we make the value of Number in the first new record to be equal to the number from Line 2 then we add the value of the range number we are on in the loop. So the first one will be + 1, then +2, then +3, etc.

      • Web_Namer
      • 2 yrs ago
      • Reported - view

      Fred Thank you!!!

    • Mel_Charles
    • 2 yrs ago
    • Reported - view

    not sure but this might offer some clue re random generator

    and maybe you could use digits as text?

    https://forum.ninox.com/t/g9hr6x5

Content aside

  • Status Answered
  • 2 yrs agoLast active
  • 3Replies
  • 73Views
  • 3 Following