I thought I would share this in case anyone else goes through the same horrifying experience I did.
I was designing a form for a Request Data task for a workflow. This particular workflow is quite complex, and this particular form has 80 odd fields on it. I had been building it up bit by bit, and then clicking Save in the form designer, previewing the form testing the validation and conditional formatting rules for the latest set of controls. I had been doing this reitteratively for about 2 hours when my browser crashed. (No worries I thought, after all I had clicked Save in the form designer a mere 2 minutes ago).
Once I reopened my browser, opened the workflow, opened the properties of the task and went to edit the form, only to find it had reverted to how it was some 2 hours earlier, which is when I had last saved the Workflow.
Lesson Learned: When designing complex forms;
- Make changes to form
- Save the form
- For those of you who are extra paranoid (I know I am now) Export your form to an xml file
But still, there's a Save button in the form designer, and I'd been clicking it religiously after each change, surely a more recent copy of my form was somewhere?
After much poking around my SharepPoint site I found http://<site URL>/NintexForms/Forms/AllItems.aspx
Which contained a number of files with names like nf_227092086fc04e8a8f2f55970ba80f3b.preview.xml the latest of these was timestamped a mere couple of minutes before my browser crashed. Viewing the contents of this file showed me something that looked a lot like my form as it was not long before my browser crashed.
So I tried importing it in the form designer, but to no avai it rejected the file. Not to be beaten, I perservered.
I then exported a form from the designer and compared the xml, and there were some obvious, although very minor diferrences. With a few minor edits, I managed to create an xml file that I was able to import into the form designer. Here is what I had to do:
The first line of my recovered file was:
<?xml version="1.0" encoding="utf-16"?><PreviewForm xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Nintex.Forms"><Form><Css>
So I renamed the PreviewForm tag to Form, and removed the now redundant <Form> tag so the line becomes
<?xml version="1.0" encoding="utf-16"?><Form xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Nintex.Forms"><Css>
Next I edited the last line which looked like this:
</Script><ScriptUrls xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d3p1:string></d3p1:string></ScriptUrls><ShowGridLines>true</ShowGridLines><TimeZone i:nil="true" /><Version>1.2.1.0</Version></Form><FormVariables><FormVariable><AutoRender>false</AutoRender><Choices xml ............... </FormVariable></FormVariables></PreviewForm>
Removing everything after the </Form> tag. Leaving the last line looking like this:
</Script><ScriptUrls xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><d3p1:string></d3p1:string></ScriptUrls><ShowGridLines>true</ShowGridLines><TimeZone i:nil="true" /><Version>1.2.1.0</Version></Form>
The resulting file then imported hapily into the form designer, and there was my form exactly as I had left it before my browser crashed.
After that I just had to recreate a couple of WorkFlow variables that I had created during my previous editing session, and viola I was back where I had been (and I'd only spent 45 minutes recovering my form, rather than 2 hours recreating it).
Presumably the nf*.preview.xml files I had managed to locate are created when you preview a form from the form designer. No idea how long they hang around for, but they definately come in handy in this situation.
While I sincerely hope you never find yourself in this situation, If you do, hopefully my experiences can save you some pain and angst.