Nov 2, 2010
visibility 5134
star star star star star
(1 votes)

XForm reserved names for input fields

There's a bug in the XForm implementation that "allow" users to add a input field with the name "id". I put allow in quotes because in CMS 6, the XForm edit dialog will crash and not let you save the XForm. But in CMS 5+ it actually lets you save it and it will later crash when you're trying to get the form data out. Mohahaha-haha... This is especially evil when migrating over from CMS 4, as there was no problem having a field called id there, so you could have a whole bunch of these just waiting to explode after you migrated.

This behavior is because id is a reserved keyword for XForms. So it's important to tell this to your editors.   

And it doesn't stop there. if you import a form from CMS 4 into CMS 6 and get this error, the normal thing would be to delete it and start anew, but oh no. That would be to easy right? Because you can't delete it in XForm editor. Actually you can't do anything because it will crash as soon as it tries to read the XForm's xml definition.

Database to the rescue!

By now you might have started to sweat. But take it easy, you can remove it, but you will have to do it directly in the database. First thing you want to do is to find the offending XForm in the tblSystemBigTable (or the more convenient way of using a view: dbo.VW_XForms). The column FormName hold the XForm's name so you can locate it that way (or using Windmill Explorer). The row also contain the GUID for the XForm. Use this GUID to remove the XForm from the tables it is referenced in by using it as the input for the stored procedure dbo.BigTableDeleteItem. This should take care of it and you should not see it in the XForm browser anymore or in a property.

CMS 5 R2 SP2

"What about me" you say? Well for you it's easier or harder depending on what you want to do.

If you want to delete the XForm and go on with your life, than it's easier, as you can do it as you normally would via the XForm editor. But if you want to extract the data, it's harder.

"Uh yeah that's great, but what about all the data. Can we get that back?!"

Yes! In CMS 6 it's a bit easier because the data isn't serialized, i.e it is in plain text. And every XForm automatically gets its own database view that will show you the submitted data, so use those. If you don't want to use the database you can always write something that takes the values and writes them to a csv file or something similar. And this is exactly what I've done, but for the CMS 5 R2 SP2 version. This because the CMS 5 versions doesn't have any views and the data is serialized, so it's much harder to extract it directly via a SQL script.

The "tool"

This tool is for CMS 5 R2 SP2 and it's not tested at all (well it runs!). The idea is to give you the basic code skeleton and you can then modify it to your needs. So if you are going to use it you should first go through and understand the code and then do the necessary changes. But hopefully it is easy to understand and if you do some improvements you are welcome to post them here for others to enjoy (pleaase do some refactoring, pretty pleeeaase ;).

XFormExport.zip

Installation: Include the files to your project and compile.

Instructions: Input the XForm's GUID (use Windmill explorer to find it) for which you want to export the form data from. The tool then goes through all the form data postings and writes them to a file in c:\temp\xform, so make sure the IIS account has write/read access to it.

 


The error you receive when trying to save the XForm or export data from it:

Property Id must be of type System.Guid or EPiServer.Data.Identity

Nov 02, 2010

Comments

smithsson68@gmail.com
smithsson68@gmail.com Nov 2, 2010 09:50 AM

Hi Tobias.

Great information!

Paul.

Nov 2, 2010 10:00 AM

And yes there is a bug report about it and it has been fixed for the next release of CMS 6 :)

Bug #57900: Editors are allowed to save XForms with input fields named "id"

Huy Le
Huy Le Nov 3, 2010 09:46 AM

It's great Tobi ;)

error Please login to comment.
Latest blogs
Finding Thomas Part 3 - The Moment of Recognition

Remember Thomas? In digital landscape, Thomas is the returning visitor who reads everything, opens every email, converts on nothing. In standard...

Ritu Madan | Jun 26, 2026

Add more scheduled job settings from the Optimizely CMS 12 admin UI -- with OptiScheduledJob.ExtraParameters

  Optimizely (EPiServer) CMS 12 ships a great scheduled-jobs framework, but it has one frustrating gap: a job has nowhere to store its own...

Binh Nguyen Thi | Jun 25, 2026

Automated Search & Navigation to Graph Migration with Claude Code

A Claude Code plugin that scans your S&N codebase, applies Graph SDK transformations, and validates the result. Install once, run one command. CMS ...

Connor Fortin | Jun 24, 2026

Migrating from Find to Graph: Lessons Learned from a Real CMS 13 Project

While migrating a search solution from Optimizely Search & Navigation (Find) to Optimizely Graph in CMS 13, I encountered several issues that were...

Binh Nguyen Thi | Jun 24, 2026

Optimizely: Upgrade Opti-ID and .NET 10 in CMS 12

Many Optimizely customers are planning their roadmap around a future migration to Optimizely CMS 13. As a result, upgrades such as Opti ID adoption...

Madhu | Jun 23, 2026 |

Understanding Optimizely Graph: Caching, Webhooks & Avoiding Stale Content (Optimizely SaaS CMS)

📌 Scope: This post covers Optimizely CMS (SaaS) only — using the official @optimizely/cms-sdk and @optimizely/cms-cli packages with Next.js 15. If...

Kiran Patil | Jun 23, 2026 |