Duplicate Child Component From Parent

  • matt_82432-1309409325478838303

    Matt

    4 months ago

    Hey guys,

    I'm completely new to toddle and am trying to set up a 'habit tracking' component that can create new child 'habit components' when a user click the 'add habit button'.

    I've set up a click event on this button and believe i need to set up a repeat formula on the child component but can't seem to get it working! Any advice would be much appreciated.
    1309409326712229930-image.png
    1309409325831164024-image.png
    1309409327169142814-image.png
  • lucasg-1309411190602076220

    Lucas G

    4 months ago

    To repeat, you'll need a array. Create a habitList variable for example (initial value should be an empty array) and on button click, append the new habit to the list
  • I see you are trying to write a formula in the value
  • Use that field only if you want to set a string or number
  • Use the formula button to the right of the field to set up the proper logic
  • You'll see an Append node in the formula list
  • matt_82432-1309744473911328859

    Matt

    4 months ago

    Hey Lucas!

    Thanks for this. I'm still a bit lost unfortuantely. Would you be able to send through a couple of screenshots with a basic example of this?

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.