Forms not submitting

Anyone else having issues with update forms not saving data. The form submits fine but any changes made are lost.

Craig

1 Like

@CSWinnall I’ve possibly experienced this in a client’s app.
Can you see any duplicated records being created within the form’s table/object with the new form values?

No loss of data, but Knack is running excruciatingly slow for me today.

1 Like

Hi

Not sure if it is anyway related, or if Stephen was referring to our situation, but this morning we suddenly lost the connection from our Location data table to the 18 or so connected tables, and are now almost “dead in the water”.

We’re not sure if this is in anyway related to our previous issue of not being able to create a table from a day or so earlier, which remains unresolved.

Regards
Dean

No new records created. The form submits but no data is saved. It happened a few weeks ago and knack did a fix pretty quick. I’m guessing an update they did overrode the fix.

We have figured out what’s going on.

Knack is adding a query string to some URLs on pages :

#inductiontreatment/historic-clients/client-details/6487372a62800a0027207dc0/risk-assessment2/6487372a62800a0027207dc0/risk-of-seizures/6487372a62800a0027207dc0/?recordId=6487372a62800a0027207dc0&objectKey=object_123

Even pages that have nothing to do with object_123. Looks like we might have to add some code to strip the query string on pages that have forms.

Craig

Yikes. Do they know the cause?

They haven’t said yet but I imagine it’s to do with this:

  • Forms: Auto-populate Connection fields when adding child records from a parent record
    • When you create a child record from its parent record, the form will now automatically populate the Connection field that links the two records. The Connection field will be populated automatically but will remain editable, so you can adjust it as needed.
    • If the form contains more than one Connection field to the parent record, all Connection fields will be populated automatically but will remain editable, so you can adjust them as needed.
    • :white_check_mark: Auto-population improves efficiency and reduces manual errors.
    • :white_check_mark: Connection fields are editable for flexibility.
      Example scenario:
    • Set up your app like this to see the improved behavior in action:
      • Create a Login page with Admin access.
      • On the main page, add a Grid displaying Customer records and enable the Details column.
      • On the Customer Details page, add a Form to create a Credit record, connected to the current Customer. Set up a submit rule to redirect users to a new child page after form submission.
      • On the child page, add an Update form for the Account record connected to the Credit records of the current Customer. For simplicity, only include the Credit connection field on this form.
    • Test in the live app:
      • Log in and navigate through the pages.
      • Once you reach the final form, check the Credit connection field.
    • Before this improvement, the field would appear empty or locked, making it difficult to select the correct Credit record. Now, it’s automatically populated with the expected value.

Hi all,
Very sorry for the issues you are seeing - we are actively investigating and I’ll keep you updated as I learn more.
Thanks,
Kara

Hi @Kara

Thank you.

Craig

We are working on a fix - it is almost ready to deploy.

2 Likes

We are having the exact same problem as described by CSWinnall. First noticed it yesterday with a form to edit our “Destinations” table. I tried recreating both the form and the menu linking to the form, but problem is the same (when I click the submit button the form “blinks”, but does not show a conformation message (or error message) and does not save the changes). Thank you for bringing this up and glad to see the Knack team is investigating.

Hi @shipping

If you add this code it will fix it sitewide until a fix can be provided:

Knack.router.on('route:viewScene', function (slug) {
    if (slug) {
            // Get the full location hash which includes both slug and query params
            const fullHash = window.location.hash.substring(1); // Remove the # character

            // Check if there are query parameters
            if (fullHash.includes('?')) {
                const [path, queryString] = fullHash.split('?');

                // Parse query parameters
                const params = new URLSearchParams(queryString);
                const recordId = params.get('recordId');
                const hasObjectKey = params.has('objectKey');

                // Check if we need to modify the URL
                const recordIdDuplicate = recordId && path.includes(recordId);

                if (recordIdDuplicate || hasObjectKey) {
                    // Remove parameters that should be cleaned
                    if (recordIdDuplicate) {
                        params.delete('recordId');
                    }

                    if (hasObjectKey) {
                        params.delete('objectKey');
                    }

                    // Reconstruct the URL
                    const newQueryString = params.toString();
                    const newHash = path + (newQueryString ? '?' + newQueryString : '');

                    // Redirect to the cleaned URL
                    const baseUrl = window.location.href.split('#')[0];
                    const newUrl = baseUrl + '#' + newHash;
                    window.location.href = newUrl;
                }
            }
    }
}

Paste this code in your Javascript window in the builder.

Craig

1 Like

Thanks @CSWinnall

I tried your code but it didn’t fix the problem. We have other custom code, so maybe it is interacting somehow? Either way, we only use this feature of Knack internally (our customers and clients cannot edit the form in question), and I’ve been able to go into the builder and make the few edits I needed to make, so we’ll just wait on the Knack fix. I do appreciate you reaching out though!

1 Like

@StephenChapman @CSWinnall @shipping

Would any of you be available for a quick call? We would like to take a look at some configurations of the table, form, & rule.

@Kara I’d be available.

Thank you! I will email you an invite

Fixes have been deployed - you may need to refresh the Live App browser

2 Likes

@Kara Thank you! Its working well for us.

1 Like

Sorry missed this I’ll check the fix in the morning.