I’m working on a feature where users can add questions after generating proposals. However, the number of questions varies by job posting. I’d like to provide an option for users to dynamically add input fields based on the number of questions they have.
Is there a way in WeWeb to create a button or mechanism that, when clicked, adds a new input field for users to enter their questions? Ideally, users should be able to add as many input fields as they need.
Has anyone implemented something similar or can guide me on the best approach to achieve this in WeWeb?
This is almost the right solution. Instead of appending empty “” string at the end of the array, in my opinion more elegant would be if you added an object. This way you can later go and bind values at questions[index].answer. By using a string, you’d be complicating your life in the next steps
So what you would do, is actually have a following logic:
Display your proposals by binding them to a variable and binding that variable to your repated list
Add a button for each of them
Create an array item.questions, ideally on each first click of button (could be a condition to check if !item.questions (the array questions doesnt exist) then create one
On click of each button to add a question append to item.questions an object
For each inputed question/answer, you should ad an on change workflow, that will set the item.questions[item.index].answer (or question) and store it as an value of the object.
Hi I tried to follow you instruction, but I canno’t produce a similar features which can be related to adding a comment to a post on social media,
I have different object where i need to add specific user input, I want to store as object in my xano item, with label + user input