Episerver forms - Overwriting submission data

Hello, Iam trying to overwrite input values on a submission on the formssubmitting event. This is my code:

  [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    [InitializableModule]
    public class EpiserverFormsInitializationModule : IConfigurableModule
    {
        private Injected

This code works and replaces the value of the in this case "pageID" input field that i have in my form. When i export the submission forms from episerver edit i get a list that represents the new value correctly. But in the "Forms submissions" tab in episerver edit in a form the view is empty. 

If i remove the code that adds a new keypair value and post my form again the view is full again and the forms where i changed the "pageID" are also there with the new value. 

I need a better way to go about this because i think iam missing something, thanks!

#150936
Jul 04, 2016 11:10
Vote:

Found the problem :) 

pageId = new KeyValuePair<string, object>(pageId.Key, pageReference.ID);



should have been 

pageId = new KeyValuePair<string, object>(pageId.Key, pageReference.ID.ToString());



Database was not expecting an int, its always the little things that get you..

#150951
Edited, Jul 05, 2016 10:41
error This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.