# Save datas fields in FormData with .NET Code

**URL:** <https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981>\
**Category:** Development\
**Created:** [March 7, 2018, 12:35pm UTC](https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981 "2018-03-07T12:35:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![qpomarel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/qpomarel/32/262_2.png) [@qpomarel](https://discuss.workflowgen.com/u/qpomarel)\
**Post date:** [March 7, 2018, 12:35pm UTC](https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981/1 "2018-03-07T12:35:36Z")

</div>

Hello,

We want to save content of text field in formdata with click a button, we tried solution at [How to modify any form data fields in .Net Web form](https://discuss.workflowgen.com/t/how-to-modify-any-form-data-fields-in-net-web-form/665)

How is it possible to update value directly in formdata content, this properties are just read only.

```
 protected void DEMANDE_BOUTON1_Click(object sender, EventArgs e) {
    DEMANDE_DESCRIPTION.Text += "test1 \n";
    
    SaveFormData(this.FormData);
    this.BindFormDataToFields(this.FormData);
}

```

We need to implement this to allow a saving without click on sending button.\*

Thanks,

Regards

---

<div class="post-metadata">

**Author:** ![qpomarel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/qpomarel/32/262_2.png) [@qpomarel](https://discuss.workflowgen.com/u/qpomarel)\
**Post date:** [March 21, 2018, 10:47am UTC](https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981/2 "2018-03-21T10:47:17Z")

</div>

Hello,

To complete my previous question, is it possible to execute form\_draft code button without completing action ?

When we want to save form\_data, if is it possible we want to execute saving code.

Thanks,

Regards

---

<div class="post-metadata">

**Author:** ![kevin.lee](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@kevin.lee](https://discuss.workflowgen.com/u/kevin.lee)\
**Post date:** [April 25, 2018, 2:48pm UTC](https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981/3 "2018-04-25T14:48:15Z")

</div>

Hi,

in your sample code, you update the field DEMANDE\_DESCRIPTION but you are not saving it to the FormData yet.  
You need to call SaveFieldsData(FormData) to capture the updated value in DEMANDE\_DESCRIPTION before calling SaveFormData.

Or you can update update FormData dataset directly. So it could be like:  
DEMANDE\_DESCRIPTION.Text += “test1 \n”;  
FormData.Tables[0].Rows[0][“DEMANDE\_DESCRIPTION”] += “test1 \n”;

SaveFormData(this.FormData);

---

<div class="post-metadata">

**Author:** ![qpomarel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/qpomarel/32/262_2.png) [@qpomarel](https://discuss.workflowgen.com/u/qpomarel)\
**Post date:** [May 3, 2018, 11:12am UTC](https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981/4 "2018-05-03T11:12:24Z")

</div>

Hello Kevin,

Thanks for your aswer.

We tried your solution, but we had same results, no save after closing.

This is a specific use case :

- User write data in specific field
- He left form without saving

So we want to save in FormData without using sending or draft buttons, but presently the current formdata isn’t overwrite.

---

<div class="post-metadata">

**Author:** ![kevin.lee](https://avatars.discourse-cdn.com/v4/letter/k/65b543/32.png) [@kevin.lee](https://discuss.workflowgen.com/u/kevin.lee)\
**Post date:** [May 3, 2018, 4:33pm UTC](https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981/5 "2018-05-03T16:33:00Z")

</div>

Hi Quentin,

If I understand your use case correctly, you want to save the form without any WorkflowGen submission.  
If this is the case I don’t think it is possible unless you build some kind of mechanism to store your form data somewhere.  
WFG needs the action submission (submit or save as draft) in order to pass the current form data back to WFG backend so that when next action start it can retrieve the form data from previous action

---

<div class="post-metadata">

**Author:** ![qpomarel](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/qpomarel/32/262_2.png) [@qpomarel](https://discuss.workflowgen.com/u/qpomarel)\
**Post date:** [May 3, 2018, 4:54pm UTC](https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981/6 "2018-05-03T16:54:54Z")

</div>

Hi,

> If I understand your use case correctly, you want to save the form without any WorkflowGen submission.

Yes that’s it, it’s a twisted case.  
Howewer, it could be an evolution perspective for workflowgen.

Thank’s for your help.

---

<div class="post-metadata">

**Author:** ![noemief](https://avatars.discourse-cdn.com/v4/letter/n/a587f6/32.png) [@noemief](https://discuss.workflowgen.com/u/noemief)\
**Post date:** [April 21, 2022, 12:43pm UTC](https://discuss.workflowgen.com/t/save-datas-fields-in-formdata-with-net-code/981/7 "2022-04-21T12:43:23Z")

</div>

Hello Quentin,

I allow myself to ask you if you managed to solve this problem. I’m trying to save my data without submitting when I click on a button.

Thank you,  
Noémie
