Create list item with button

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
MikeDLato
Posts: 9
Joined: Thu Jun 02, 2016

02 Jun 2016

Hi There,

I have built a custom SPForm that captures registration data for seasonal workers. When the season completes I want to have the user click a button that creates a new list item in a different list (season history) with a subset of data from the original form, and then blank out the values on the main form. I thought of doing it with a workflow, however if the workflow fails to trigger, then the information will effectively be lost.

I have seen some other posts on doing this, but I haven't managed to get it to work. Any guidence would be great.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

03 Jun 2016

Hi Mike,

You can add an item to another list via JSOM. Here is a sample:

https://msdn.microsoft.com/en-us/librar ... onSection0

MikeDLato
Posts: 9
Joined: Thu Jun 02, 2016

03 Jun 2016

Thanks Dmitry. I've been trying exactly that, I've used that code in the SPForms JS Framework, set the function to global, so I can call it from an OnClick of a button, but the actual adding of the item fails. No error, just simply nothing happening. I know the OnClick call is working, because if I simply call an alert, that works fine. I'll keep pluggin away until it works, but any other ideas would be great.

Thanks

Mike

MikeDLato
Posts: 9
Joined: Thu Jun 02, 2016

03 Jun 2016

I've worked it out thanks Dmitry. I was just being a doofus and using the wrong List Title.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests