# TypeError: formdata.set is not a function

**URL:** <https://forum.ionicframework.com/t/typeerror-formdata-set-is-not-a-function/128443>\
**Category:** ionic-v3\
**Created:** [April 20, 2018, 12:03pm UTC](https://forum.ionicframework.com/t/typeerror-formdata-set-is-not-a-function/128443 "2018-04-20T12:03:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlestsmith](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/charlestsmith/32/114287_2.png) [@charlestsmith](https://forum.ionicframework.com/u/charlestsmith)\
**Post date:** [April 20, 2018, 12:03pm UTC](https://forum.ionicframework.com/t/typeerror-formdata-set-is-not-a-function/128443/1 "2018-04-20T12:03:09Z")

</div>

Hello All,  
I’m using FormData for one of my ajax call in Ionic.  
var formdata = new FormData();  
formdata.set(‘action’, “myActionName”);  
formdata.set(‘senderId’, data.senderId);  
formdata.set(‘friendId’, data.friendId);

its working perfectly okay on Android but on iOS it says:  
TypeError: formdata.set is not a function. (In ‘formdata.set(‘action’, “myActionName”)’, ‘formdata.set’ is undefined)

Anyone know how to define the formdata.set?

Thanks in Advance!

---

<div class="post-metadata">

**Author:** ![murwa](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/murwa/32/120412_2.png) [@murwa](https://forum.ionicframework.com/u/murwa)\
**Post date:** [July 19, 2018, 11:59am UTC](https://forum.ionicframework.com/t/typeerror-formdata-set-is-not-a-function/128443/2 "2018-07-19T11:59:20Z")

</div>

@charlestsmith I have the same issue on a few android devices. Did you find a solution?

---

<div class="post-metadata">

**Author:** ![murwa](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/murwa/32/120412_2.png) [@murwa](https://forum.ionicframework.com/u/murwa)\
**Post date:** [July 19, 2018, 5:02pm UTC](https://forum.ionicframework.com/t/typeerror-formdata-set-is-not-a-function/128443/3 "2018-07-19T17:02:14Z")

</div>

Hey, so the solution is to avoid set (and get, getAll etc). If you log the FormData object for failing devices, you can see it has only the `append` method. Check out this [SO answer](https://stackoverflow.com/questions/33004860/formdata-get-function-is-undefined)

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:39pm UTC](https://forum.ionicframework.com/t/typeerror-formdata-set-is-not-a-function/128443/4 "2021-07-19T21:39:00Z")

</div>

Closed on July 19, 2021, 9:39pm UTC


