Creation of elements after a button click

Hi ! I would like your help for creating elements with DynamicComponent.

I have a list of items in a listpicker, when I select an item, I add (for each of them):

  • a text (which takes the name of the element)
  • two textboxes
  • a button

For that, okay it works.

I would like that each time I click on the button, it adds on a line, two new textboxes (above this button). And this is where I got stuck, I get an error. Here are my blocks:


Could you please help me ?

EDIT :

I added this to the button block:

And here’s what happens:

Looking similar like this???

You need a unique ID for your Blocks. Try to replace your 2 in the ID with a up counting number on every Button Press.

That’s almost it, I’d rather like something like this:

When I select an item from my list it adds:

  • a vertical arrangement
  • a label which takes the name of the element
  • a horizontal arrangement
    — 2 side by side textboxes
  • a button

This button create below the textboxes will be used to add two textboxes again (therefore redo the same diagram as the horizontal arrangement)

I did not understand everything (I use google translate), but I think I understood the main meaning, I will try later, thanks. But if you have a quick example in aia it would help me better

Saraswathi pooja happening at home… i hope you will have already ready made block, just sent it to me (demo aia) here or in pm let me fix it. If not it will be horrible to drag and drop multiple blocks in the crucial time

1 Like

I’m trying to do this tonight after work, thank you!

1 Like

Give me a sec to send you a test aia

Try this

add_textbox.aia (40.1 KB)

1 Like

you are almost close to his concept. But the fact is, if he selects another list item it have to create another whole set up. (i.e label, and two text box)l

I think, this like he is expecting…

Add_Elements_DC.aia (39.1 KB)

From the video, that’s what I’m looking for! I test the aia file and get back to you! Thanks :smiley:

1 Like

Yep! This is exactly what I want, thank you! With that, I’ll try to save all the info entered in the textboxes in Airtable, I’ll get back to you if I can’t.

Thanks to both of you for taking the time to help me out, and thanks @Still-learning for the solution!

1 Like

Add_Elements_DC(1).aia (41.2 KB)

This will give you text box along with id of the box, so you can take the text from the concern boxes easily while saving values into the airtable.

1 Like

And with this method, I just have to use a button to save each item in the list? Thank you so much ! I didn’t even have time to think about it ^^ Thanks!

Hmm, it actually saves me the id of the textbox, but not the content I write inside

blocks(6)

it means you have not taken the text of the dynamic component id, instead you have taken only the id

Not working

no , you have not used the dynamic component

image

here use the id, instead of label use text box

In fact, my goal so that you can understand more easily, I would like to count the number of hours spent for a client (for my work).

Example, the litpicker contains all the names of the customers.
Textbox 1 will contain the type of work (on a machine, paint, labor, etc.)
Textbox 2 will contain the number of hours (I think to change it by a time selector, it will be maybe more ergonomic than the textbox);

And a button which validates, and which saves me the data. I already have a database that works, but is not practical, I record by date, my arrival and departure times, but I want to improve the customer part.

@Still-learning Here is to schematize, the tree structure of what I want to obtain

So, I used Airtable because I find it easy to use, but if there is something else more practical for my purpose, then I will change my method! With Excel for example (or GoogleSheet?)