Get Element ID on Click?

  • alexsiale_17363-1314190843162132561

    Alex

    4 months ago

    I have a form modal that pops up when I click these buttons inside a repeat list.

    How Can I populate the variables in my form with this elements data?

    Because I want to then create an UPDATE flow to submit the form changes to Supabase and PUT an update...
    1314190843845935134-Screenshot_2024-12-06_at_12.23.37_AM.png
  • alexsiale_17363-1314191516020899903

    Alex

    4 months ago

    Oh I think I fixed it by adding click events to set variables?
  • chrislaupama-1314191560048508959

    Chris Laupama

    4 months ago

    Create a variable to store the index of the item you are clicking on.

    Then you can just use that index to obtain the data from that index in the array and pre-fill the values of the input fields of the form.
  • alexsiale_17363-1314191586569097316

    Alex

    4 months ago

    I don't know if my approaches are hacky...
  • Oh, yours sounds way sarter
  • smart*
  • chrislaupama-1314192127873519706

    Chris Laupama

    4 months ago

    Your way works fine too
  • alexsiale_17363-1314192257766789141

    Alex

    4 months ago

    oh okay cool haha
  • alexsiale_17363-1314193160540389448

    Alex

    4 months ago

    mean
    1314193160628604958-Screenshot_2024-12-06_at_12.34.19_AM.png