Wappler Version : 5.8.2
Operating System : Windows
Server Model: NodeJS
I am attempting to access FormRepeat items outside of the form-repeat. For example, in my use case I am trying to save changed data of the form repeat via flow action inside a datastore.
Using the dynamic data picker in the Wappler UI results in ‘formrepeat.input_name.value’ being picked as value. I have also experimented using ‘formrepeat[0].input_name.value’ and formrepeat.items[0].input_name.value’ to see whether the data is accessible at all.
Expected behavior
Using the dynamic data picker and/or one of the variations mentioned above should allow me to access and output the data inside the formrepeat item.
Actual behavior
The data is not accessed properly. Storing it inside a data store will result in the fields being empty.
According to these threads, it should have been possible to do so since Wappler version 5.0.2:
It seems I am not the only one encountering this, as there are previous mentions of people not being able to access form repeat data as desired:
Thanks for your reply. It seems the issue occurs, when a Form-Repeat is used without it being encapsulated in a Form. I still run into the issue when simply using the ‘repeat’ (which seems to be the more accurate class since the form isn’t used as such) instead of the form repeat.
This is the flow:
<script is="dmx-flow" id="flow_question_text" type="text/dmx-flow">{
alert: {message: "{{'Text is: '+questions[0].question_text}}"}
}</script>
You already know which value is passed by clicking the button or we have to find a way to accomplish that?
Can you just include the button inside the repat (with the input question_text so toy know by the $index its value?
Thank you for your reply! Yes, the example use case doesn’t make much sense, since I only created that for demonstration/debugging purposes.
In my actual use case, I have multiple input fields inside my repeat region, and I want to access that data using a flow without having to manually pass each field as a parameter. I would theoretically want to pass the $index value to the flow, so I know which repeat to access, but for testing purposes, I tried to access the repeat with index = 0, just to see whether the access works in general in order to circumvent possible problems when trying to pass an index value dynamically.
So, please explain me, what exactly this button does and why it has to be outside the repeat…
As a matter of fact, please tell us what you want to archive so we follow along.
You talked about datastote… What is the final concept?
Updating each record(line) of your repeat directly?
The button doesn’t have to be outside of the repeat; it just happened to be for testing purposes. The issue is that accessing the input fields outside of the repeat does not appear to work.