I have a list of items that also need to have an input field for data to be entered in. The list is dynamic (Server Connect data). How can I submit a form with a dynamic list of data as an array.
I keep trying to do the form repeat or the DataStore option however non of these have resulted in success.
If I understand your requirement correctly, add a serverconnect form, add form repeat inside the form with a server connect dynamic binding that is fetching the list of items.
In addition to displaying the list of items, provide an 'input' element to enter new data.
Then you can POST the server connect form that includes the list of items (ID, name etc.) and new data entered in the input fields. The data will be POSTed as an array, so you can run a repeat in the API to save new information for each item.
I've been able to temporary add an input field inside of the form repeat component that has the value of the ItemCode variable, however it is my understanding that a Form Data component should work under the same principals like an input field, even when it's in a Form Repeat.
As highlighted in my previous reply, this code is submitting / loading dataLinesItems, which is not the same as submitting the serverconnect form that contains the form repeat. I'm not familiar with dmx-form-data element and whether it can be used to POST data / values.
To POST values as an array from a repeat, you need input elements in a form-repeat inside a serverconnect form. There are already two input fields - qtyShipped and dataItemCode. If you modify the dynamic change event to submit the main serverconnect form formSubmitShipment, then it will POST the form-repeat and its input values as an array.