I wanted to create a phased or progressive form. I have all of my question in the Supabase, and every detail which needed like types, options, placeholder, ID, and dependent answer. I created the form using custom inputs. Now I some questions are dependent to other questions, meaning some question may be shown or hide depending to the answer to certain question. How can I do that? I am thinking using a dependent answer for logic of visibility. How can I store the answer in the plasmic? And which way should I make the logic?
Hello @its_the-sa, I think your idea of using a dynamic value for visibility is correct. For that, you may need to store your answers in state. You can learn more about states in our docs: Interactions and state reference | Learn Plasmic
You may also consider using a nested form for each step in the progressive form, and configure the nested form’s onSubmit interaction to update the state so it can decide which questions to show in the next step.
thank you for the reply. I have actually done almost everything. Just now the main issue is capturing input. I do not know how to capture input in a state variable. like formData an array state variable, and I want to store all of the values in there. but in structure.
The thing is I am not using button to capture the inputs. like clicking next to next question. I need it like when you write it will be store at the same time.
If you are using Plume form, you should be able to access the form value in $state.form.value
I am actually not using any form component, I am actually using a vertical stack of inputs. Because I wanted to have custom form.
Please share your project id with arena/component details
My project ID is r7DbSv6QvWZ6yyXzZHvAYp in the patient form Page inside there is a section name form
I see a couple of issues here:
- The booleanButton needs to use onValueChange instead of onChange. The onChange seems to be doing nothing and can be removed from the component props list. It’s the onValueChange that triggers when
value 2
changes. - The code expression in the onChange interaction seems incorrect. There is no event available. You should use
val
to fetch the change - The booleanButton value prop is incorrect. Its assigned a value of $state.booleanButton which is an array. You can use
false
instead as the prop’s value to make it work.
Yeah, I think there is alot of problem creating any custom field in the plasmic studio from scratch. Need enough knowledge. So I opened another one used the custom field there: 5Zg9n9VVQm3GpGMqm4vDHh. Can you check this out.
Hello, I want to know if like in form, I can capture currentitem.id (a id number), currentItem.input_type (quesiton type) and input value in a structure which I can use for some fields visibility because some answer are dependent with quesitons?