Home › Forums › vLooup for SharePoint › Push Multiple items to sharepoint list
- This topic has 7 replies, 4 voices, and was last updated 5 years, 4 months ago by Alexander Bautz.
-
AuthorPosts
-
-
November 16, 2016 at 15:02 #14179
Hi Alex,
Is it possible to create multiple list items at a time in sharepoint list using DFFS in vlookup screen?
By default the form needs to expose fields for a single record, but also include an option to add another item without displaying a new page.Thanks,
Navya -
November 18, 2016 at 23:54 #14210
Hi,
I’m not sure I understand what you mean. If you set up a vLookup connection between two lists, you can add as many “children” as you like in one session, but to fill in the NewForm on each child you need to bring up the Child item NewForm and save between each added “child”.If you are looking at creating for example a predefined set or “tasks” as children to a list item, this could be done using a few lines of custom code that adds the items programatically.
Let me know what your requirements are, and I’ll do my best to help you.
Alexander
-
November 21, 2016 at 11:58 #14218
Hi Alexander,
Thanks for the quick reply.With vlookup user can add as many child records as he want,to do this every time user needs to open the new form and click save, repeat the process…
In my case user wants to add multiple child records at a time in single new form.
Is there a simple way we can configure in DFFS lookup to add multipule records in the single save.
please find the screen shot for more details.Thanks,
NavyaAttachments:
-
November 22, 2016 at 22:08 #14233
I’m sorry, but there is no built in support for this at the moment. Is it only one multiline textfield you want to save to each of the child items, or is it a full “new item” with for example “Title”, “Responsible”, “Category” and “Description”?
Alexander
-
January 13, 2017 at 10:43 #15027
I think this something I’m looking for right now as well.
I have an InfoPath form I need to replace – but this form has a repeatable table where the user can add multiple elements in one got.
I guess this is what is needed here?Thanks
BR,
Nicole -
January 24, 2017 at 22:06 #15258
I’ll see what I can do with the next version, but I don’t have a release date on this yet.
Alexander
-
July 19, 2019 at 15:11 #26141
Hello,
I was looking for the same type of solution (ability for user to add multiple items within a single form) and found post in the forum. Has this ability been implemented in the current release?
Thanks,
Anne -
July 19, 2019 at 18:37 #26145
Hi,
No, there is no built in function that lets you do this, but it can be done with some custom code – here is an example that adds a new item to a list called “YourChildList” – change this to match your list name or GUID, and change the “Description” field to whatever your field is called.The code will write the _vLookupID of the parent to the field _vLookupParentID in the child so you can pull the data back with a normal vLookup field configuration.
Add this to your Custom JS:
function addNewLine(){ var b = []; b.push("<div class='newItemWrap'>"); b.push("<div class='newItemLabel'>Title</div>"); b.push("<input type='text' class='addNewInput'>"); b.push("<div class='newItemLabel'>Description</div>"); b.push("<textarea class='addNewTextarea'></textarea>"); b.push("</div>"); jQuery("#addItemsPlaceholder").append(b.join("")); } // Call function on load to add first placeholder function dffs_ready(){ addNewLine(); } function saveAllNewItems(){ var data = {}, vLookupID = getFieldValue("_vLookupID"); // Add _vLookupParentID data._vLookupParentID = vLookupID; jQuery(".newItemWrap").each(function(i,cont){ data.Title = jQuery(cont).find(".addNewInput").val(); data.Description = jQuery(cont).find(".addNewTextarea").val(); var res = spjs.utility.addItem({ "listName":"YourChildList", "data":data }); if(!res.success){ alert(res.errorText); return false; }else{ jQuery(cont).removeClass("newItemWrap").addClass("newItemAdded").find(":input").attr("disabled",true); } }); }
This to your Custom CSS:
.newItemLabel{ font-size:1.3em; font-weight:300; } .newItemWrap{ padding:10px; } .addNewInput{ width:100%; box-sizing:border-box; } .addNewTextarea{ width:100%; height:75px; box-sizing:border-box; } .newItemAdded{ color:#c5c5c5; padding:10px; border-left:10px green solid; }
And this in a HTML section in a tab:
<div id="addItemsPlaceholder"></div> <div style="text-align:right"><input type="button" onclick="addNewLine()" value="Add new" /><input type="button" onclick="saveAllNewItems()" value="Save all" /></div>
Let me know how this works out.
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.