Form data returns undefined

Suddenly all forms that I copy return undefined when I call the data:

At first I thought only the forms that I copied where bugged, so I replaced them all with a fresh form. This was quite time consuming, but seemed to fix the issue.

Fast forward a few days, and these forms are again causing issues. Is anyone running into the same problem?

2 Likes

I've tried copy/pasting a few form components and each time the newly pasted form has no data field. initial data is present in the form state, but without data I cannot submit the form data with a query.

This seems to happen only when copy/pasting a form - new forms I create from "scratch" (by adding an empty form component) always include the data field by default, even when empty>.

Here is the state of one copy/pasted form component:

Reproducing this is simple:

  • Create an empty app
  • Add a form1 component
  • Check the form1 component state has a data property
  • Copy/paste the form1 component to create a form2 component
  • Check the form2 component state which does not have a data property

Here are screenshots from my reproduction in a brand new blank app:
Form 1 (original) includes data (visible in both the state tab and access as an example in the "disable" field of form settings):

Form 2 (copy/pasted) does not include data:

Note: I'm showing the access of form.data inside the "Disable" setting of the form just for demonstration, I'm not actually trying to use the value in this spot.

I've looked at documentation and this forum but can't find anything related to this issue or to "adding" the data field back in. I am able to successfully trigger form submission with event handlers, but submitting the form has no impact on data property being created. If I'm missing something critical please let me know! I'd love to be able to copy these long forms instead of re-create them from scratch.

Hiya Ben!

First off, welcome to the forum and thanks so much for surfacing this.

I was able to recreate this on my end and have gone ahead and filed this with our engineering team to look into.

I'll be sure to reach out here when I am made aware of any updates! :raised_hands:

Best,
Evan

1 Like

Confirm that issue. After cut/paste forms loosing data property.

1 Like

I'm having this issue as well

Experiencing this problem at the moment. Duplicated/copied forms, or containers with forms seem to be affected.

Creating a new form and transferring components from the "broken" form is my current workaround.

Same issue here — is the fix in the meantime to recreate the form or has someone found a workaround?

I'm not able to find a work around at the moment outside of recreating the form :confused:

Confirming issue.

Also flagging that other state fields are dropping on copy and paste.

For multiselect, the following selected fields are missing on the copied component (this was in a form).

image

Thanks for the heads up! I'll note that to our engineering team as well :raised_hands:

Also getting this issue - wondering if there has been any update?

I'm seeing other posts describing a similar issue across the last few years - for me the form I was using is copied but it had been working for weeks and then recently stopped having the data attribute

https://community.retool.com/t/form-control-data-fields-suddenly-undefined/3775/5

Hi @Jeroen_Vermunt, thank you for flagging this. We were able to reproduce this issue on our end. It looks like when we duplicate a form component, the new one is missing the "data" property:

Original form:


Duplicate form:

We have created a bug report for this and we'll update you when it is fixed. Thank you for your feedback!

Same issue here.

Same issue here

Same here.

Just added the +3 to the report. Thank you for your feedback! :slightly_smiling_face:

... and welcome to the forum, @Connor_Quigley & @Ricardo_Kojima! :wave:

Same here — looks like there are duplicate issues for this in the forum. Do we have an update?

Hi @ John_Ramsey, our devs are currently working on a fix for this but we do not have a release date yet. I would appreciate if you could link us to the duplicates. I'm be happy to collect their +1s and merge them here so we can update everyone in one place.

The latest cloud release (v.3.47.0) included a fix for this issue! :tada: