Add records in a form via stateless form

Add records in a form via stateless form

I have a form(example) with three single fields (season, from, to). I also have a stateless form (example2) with 3 fields also. A lookup field(with name example) to season, and two single line fields (from, to). I also have a button (ADD). What I want is to add records from the stateless form to EXAMPLE form.

I wrote this code in on add-> On click field but it does not add records. It only updates the record. What am I missing?


  1. r = example [ID == input.example];
    r.From = input.Form;
    r.To = input.To;


UPDATE

I changed the code to the following(in the On click) but now the problem is that it returns me 1721972000000084205 in the first field.

  1. insert into example
  2. [
  3.     Season = input.example
  4.     From = input.From
  5.     To = input.To
  6. ]

From and To fields work properly.