Using a newly created Library document to create a list item and attach itself

I have a workflow that moves a document from one library to another.
When a document is moved to a certain library I want to create a list item with a link to the document in the list item.  Keep in mind there could be 10 files submitted to the library, so then in my list I would want 10 new list items created for
each file, with a link to the individual file. or is there a way to attach the document to a newly created list item programmatically?
is this possible?

Hi,
According to your post, my understanding is that you wanted to use a newly created Library document to create a list item and attach itself.
I recommend to create a workflow assocaited to the second library, and start the workflow automatically when an item is created.
Then add action as below:
Best Regards,
Linda Li
Linda Li
TechNet Community Support

Similar Messages

  • Creating a form to Add List Item and to a Document Library

    Hi,  I'm super new to sharepoint , and have what is probably a newbie question.
    I have a list and a document library.  The documents are linked to the items in the list. (1 list item may have one or moe documents associated with it).
    I need to create a form to add new list items that will at the same time upload documents to the document library.
    Do I use infopath for that?
    Thanks

    Hi,
    According to your description, when adding a new item to the current list, you might want to upload the attachments of this item to other Document Library as well.
    As a workaround, you can create an Event Receiver to capture the event when there is “An item was added”. In the Event Receiver, we can write C# code to copy the attachments
    from a list item to a Document Library.
    About how to create a simple Event Receiver in SharePoint 2013:
    https://msdn.microsoft.com/en-us/library/ff398052.aspx
    Here is the related code I use in this scenario, you can use it as a reference:
    using System;
    using System.Security.Permissions;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Utilities;
    using Microsoft.SharePoint.Workflow;
    namespace SharePointProject13.EventReceiver1
    /// <summary>
    /// List Item Events
    /// </summary>
    public class EventReceiver1 : SPItemEventReceiver
    /// <summary>
    /// An item is being updated.
    /// </summary>
    public override void ItemUpdating(SPItemEventProperties properties)
    //base.ItemUpdating(properties);
    /// <summary>
    /// An item was added.
    /// </summary>
    public override void ItemAdded(SPItemEventProperties properties)
    // base.ItemAdded(properties);
    using (SPSite site = new SPSite("http://sp/"))
    SPList docDestination = site.RootWeb.Lists["Document"];
    SPList lstAttachment = site.RootWeb.Lists["List1"];
    SPFolder fldRoot = site.RootWeb.Folders[docDestination.Title];
    SPFileCollection flColl = null;
    if (properties.ListItem.Attachments != null && properties.ListItem.Attachments.Count > 0)
    foreach (String strName in properties.ListItem.Attachments)
    flColl = fldRoot.Files;
    SPListItem listtem = docDestination.Items.Add();
    SPFile FileCopy = properties.ListItem.ParentList.ParentWeb.GetFile(properties.ListItem.Attachments.UrlPrefix + strName);
    string destFile = flColl.Folder.Url + "/" + FileCopy.Name;
    byte[] fileData = FileCopy.OpenBinary();
    SPFile flAdded = flColl.Add(destFile, fileData, site.RootWeb.CurrentUser, site.RootWeb.CurrentUser, Convert.ToDateTime(properties.ListItem[SPBuiltInFieldId.Created]), Convert.ToDateTime(properties.ListItem[SPBuiltInFieldId.Modified]));
    SPListItem item = flAdded.Item;
    item[SPBuiltInFieldId.Created] = Convert.ToDateTime(properties.ListItem[SPBuiltInFieldId.Created]);
    item[SPBuiltInFieldId.Modified] = Convert.ToDateTime(properties.ListItem[SPBuiltInFieldId.Modified]);
    flAdded.Item.Update();
    How it works in my environment:
    Add an item with attachment in List1:
    In the Document Library, we can see the uploaded attachment there:
    Best regards
    Patrick Liang
    TechNet Community Support

  • I would like to create a document with imbedded video, to email, and airdrop to an iPad mini. What program should I use?

    I would like to create a document with imbedded video, to email, and airdrop to an iPad mini. What program should I use?

    Thank you for using the Apple Support Communities
    I would suggest using Apple's Pages which allows support for imbedding videos from the device's camera roll. Pages also allows for sharing via email, Air Drop, and Messages.

  • How to create a special view for sharepoint list A and deploy this view to specific user personal view?

    How to create a public view for sharepoint list A and deploy this view to specific user personal view? Is that possible OOTB?

    Views cannot be exported or moved. Can you elaborate your requirement?
    --Cheers

  • How to print out document list items (and with all comments!)

    Hi all,
    I am wondering how to get a good printout of document lists.
    In a web application I have some document list items and the users are adding many comments in it, so that the document list item doenst show all in the initial view, but scroll buttons to navigate up and down.
    I was surprised to read that the standard print functionality doesnt support document items.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/43/68ce8391886e47e10000000a422035/content.htm
    How can I print out a list of all document list items with all comments?
    Ist there a workaround?
    thanks in advance for sharing your experiences, br, Michael

    Thanks guys for trying to help me...
    Gabriel, I not wanna do "a lot of trix" to get this out of iCal when it should be solved by iCal (from my point of view).
    Dancing Brook, Yes I hope we will see that in the future. I am convinced that there is many of us out there who want to see that function in iCal, even if they not really missed it yet.
    I have already sent a request to iCal feedback (hope they noted). Maybe they will if we are many doing so...

  • HT2128 Something must have infected my software, as of now I can't use any of my excel documents I created, what can i do.

    I AM NOT ABLE TO USE MY EXCEL SOFTWARE & WORK PAGES I CREATED FROM EXCEL. & CAN'T PLAY SOME GAMES I HAD DOWN LODED PREVIOUSLY THAT USED TO WORK GOOD. I KEEP GETTING THE SAME  STATEMENT SAYING CLICK OK TO GET YOUR APPLICATION TO WORK AGAIN.

    could be lots of things.  I'd try uploading them to google docs and see how that goes.
    You may want to run these "standard" fixes if the problem persists.
    1) Check the amount of free space on your harddrive.  You should have a several gigs free.
    2) You should run disk utility
          Macintosh-HD -> Applications -> Utilities -> Disk Utility
          a) verify the disk
          b) update your permissions.
    3) Try a safe boot.
         Shutdown your machine.  Hold down the shift key.  Poweron.  Wait awhile; wait awhile while you harddrive
         is being checked.
         http://support.apple.com/kb/ht1455

  • I created a document in Pages on my ipad and now it won't open up. How can I fix this?

    I created a document on my Ipad and when I finished it, I closed Pages. When I went to re-open Pages and see the document it wouldn't open. I click on the document and it shows the processing symbol but then the entire program closes. All of the other documents within pages open up fine, just not this one. Any help?

    Try resetting your iPad.  Hold the on/off and home buttons together for 7 or 8 seconds till the Apple logo appears.
    I'm assuming your default is to save Pages documents to iCloud, and that you had a good WiFi connection when you closed Pages the last time you tried to save the document.

  • I have been creating a document in numbers on my iPhone and synced to iCloud. Now I cannot open it, and when trying to download via browser I get an error message. How can I recover this document?

    Dear all,
    I have created a document on my iPhone, and stored it on iCloud. I have updated the document both on my iPhone and on my iPad. Now, I cannot open the document on my iPhone anymore, even a reset of the phone did not help. Via iPad I also cannot open the file, and when I try to download it to my PC via icloud.com I get an error message.I suspect that the file has become corrupt as I have updated it on the iPhone while I did not have network connectivity.
    I have two questions:
    1.) Is it possible to recover an earlier version of the file?
    2.) What can I do to prevent this from happening again in the future?
    3.) Does the iPhone sync changes to iCloud in the background or does the application need to be active?
    Thank you,
    Niftan

    Welcome to the Apple Community.
    I have seen previous versions mentioned in a pop up message before on iCloud.com, but I'm not really sure at all how it would help, as I couldn't get it to do anything.
    The best advice I have at this time is to back up your work on your iOS device by regularly saving it to iTunes, if anything goes wrong you can then either load it into the numbers app again on the device or recover it via iTunes on your computer.
    My syncs are immediate, I never get chance to see if it works in the background, sorry.

  • How to create a multi column list item and select these values from a LOV

    Hi all,
    My requirements are:
    1) create an LOV which holds the productno, productname and productprice fields (this is working)
    2) at run time, select one record from LOV and populate the list/grid with this selected record values of productno, productname and productprice fields, so we are showing them on the form in the form of a table/grid (not working)
    3) be able to select multiple records from LOV and be able to populate the list item with multiple records (not working)
    4) have two more columns in the list/grid, for productquatity and total price (not wokring)
    Please help me.
    how can i create this grid or list in oracle
    whats the possible way of acheiving this in oracle

    If you use a list item to display multiple columns then you'll need to use a fixed-width font. You can achieve a similar look with proportional fonts by using a normal block and setting the fields' bevel to 'None'.
    Each column in the LOV has a Return Item property (under Column Mapping Properties). Set this to a :block.item reference for each column to bring the data back into those referenced fields.
    You can't select multiple records from an LOV. For this you will need to create your own form. Check the help for system.mouse_button_modifiers to see how to respond to Ctrl+click and Shift+click.
    To add columns just modify the LOV's record group's query.

  • Create a black border for select list item

    Need help on creating border on a select list item.
    I tried using style ="border:1px solid black"; in HTML Form Element Attribute , but its not working for select list item, though it works on text field item.
    Nilesh

    Browsers and versions? (Always supply this information when discussing presentation and UI problem.)
    If it's IE, then this is not possible (at least up until IE7 which is all I can test on at present).
    (As HTML, CSS and JavaScript exist outside of APEX, you should search more widely than just OTN when looking for information on these topics.)

  • How to create sub-folders containg my announcment list item's images , instead of saving all the images insdie a share folder

    Today i have found this issue which i was not aware of. i have a team site collection, and inside this site collection i have an announcement App. now when users create announcement items and they insert pictures inside the items , all the images are going
    to be saved inside the site asset folder , under the following shared folder :-
    Site Assets>>Lists-->>"List Name"-->>AllItems
    so in this case users might be adding images that have the same names and select to override existing file ,, so images in this way will start conflicting with each others. so is there away to force my announcement list to create sub-folder for each item
    , and to store all the item related images inside it ?
    for example in enterprise wiki site collection, each wiki page will have a sub-folder containing all its images... so can i have the same behavior inside my announcement list ?
    Thanks.

    Also i have noted something interesting , now when users attached files or images there are going to be stored under this directory:-
    .../Attachments/41/
    where 41 is the issue tracking item ID. so for attachments each item will have separate location so files with the same name inside different items will not conflict, which is great.
    while if the user insert a picture inside the issue item such as:-
    , it will be stored inside the shared folder under the "Site Assets" folder
    Site Assets>>Lists-->>"List Name"-->>AllItems
    ,, so images with the same name from other items will get conflict between each others.
    so attachments are being managed in the correct way, as each item will have separate location to store its attachments . while images inserted inside the item description, from all items are going to be stored inside the same folder !!! can anyone advice
    ??? this is a bug in SharePoint 2013 ?

  • Sum child list items and update parent total using javascript

    I have a SharePoint 2010 Parent/Child list setup using a lookup field to join both the lists, this is working well.
    The Parent list contains requisition requests and the child list contains related item details. Each of the related child list items has a 'Line Item Total' field. I need to aggregate the Line Item Totals in the child list and place the result in a 'Requisition
    Total' in the parent. So for any given parent record the sum of it's related child 'Line Item Totals' is reflected in the 'Requisition' total in the parent row.
    I am struggling with the JavaScript code below. I am trying to aggregate Line Item Totals for a given Requisition#? Could someone please review and advise?
    <script language="javascript" src="/Purchasing/Documents/jquery-1.8.2.js" type="text/javascript"></script>
    <script language="javascript" src="/Purchasing/Documents/jquery.SPServices-2014.01.min.js" type="text/javascript"></script>
    <script>
    $(document).ready(function()
     $('select[title=Requisition#]').children().attr('disabled',true);
     $("input[title='Old Amount']").attr("readonly","true").css('background-color','#F6F6F6');
       // Retrieve the name of the selected parent item.
       var strParent=$("select[title$='Requisition#'] :selected").text(); 
     splist li = web.lists["ReqDetails"]; // This is the child list
        spquery q = new spquery();
        q.Query= "<Where>" +
         "<And>" +
          "<Neq>" +
           "<FieldRef Name='ID'/><Value Type='Number'>0</Value>" +
          "</Neq>" +
          "<eq>" +
           "<FieldRef Name='LinkID'/><Value Type='Number'>ReqID</Value>" +
          "</eq>" +
         "<And>" +
        "</Where>" +
        "<OrderBy>" +
         "<FieldRef Name='LineItemTotal'/>" +
        "</OrderBy>"
        q.ViewFields = string.Concat("<FieldRef Name='LineItemTotal' />");
        q.ViewFieldsOnly = true; // Fetch only the data that we need
        splistitemcollection items = li.getitems(q);
        foreach(SPListItem item in items)
        sum += parseInt(item["LineItemTotal"], 10);
      alert(sum)
     </script>
    Rick Rofe

    I do something similar for a PO Header/PO Detail set of lists. I use SPServices to pull the data.
    I put this code in the child edit page - so any time any child is edited, the parent is updated. I get all children records and total them up (except for the item I'm displaying at the current time. I add that value in directly from the form itself.
    <script type="text/javascript" src="/Javascript/JQuery/JQueryMin-1.11.1.js"></script>
    <script src="/Javascript/JQuery/jquery.SPServices-2014.01.min.js"></script>
    <script>var poNumber = '';
    var poDetailID = '';
    $(document).ready(function() { var queryStringVals = $().SPServices.SPGetQueryString();
    poNumber = queryStringVals["PO"];
    poDetailID = queryStringVals["ID"];
    function PreSaveAction() {
    // update the PO header with the total of all items + shipping + adjustments
    var query = "<Query><Where><And><Eq><FieldRef Name='Title' /><Value Type='Text'>" + poNumber + "</Value></Eq><Neq><FieldRef Name='ID' /><Value Type='Counter'>" + poDetailID + "</Value></Neq></And></Where></Query>";
    var viewFields = '<ViewFields><FieldRef Name="Total" />';
    viewFields += '</ViewFields>';
    var poTotal = 0.00;
    $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "PO Details",
    webURL: "/po",
    CAMLViewFields: viewFields,
    CAMLQuery: query,
    completefunc: function (xData, Status) {
    //alert(xData.responseText);
    $(xData.responseXML).SPFilterNode('z:row').each(function() {
    if($(this).attr("ows_Total")) {
    //alert($(this).attr("ows_Total"));
    poTotal += Number(parseFloat($(this).attr("ows_Total").split(";#")[1],2).toFixed(2));
    // add in this changed line (we skipped it above)
    var qty = $('input[title="Quantity Ordered"]').val();
    var price = $('input[title="Price"]').val().replace(',','');
    var extend = Number(qty)*Number(price);
    poTotal += extend;
    //alert(poTotal);
    // update the PO Header
    $().SPServices({
    operation: "UpdateListItems",
    async: false,
    listName: "Purchase Orders",
    webURL: "/po",
    ID: poID,
    valuepairs: [["Total", poTotal]],
    completefunc: function (xData, Status) {
    //alert(xData.responseText);
    $(xData.responseXML).SPFilterNode('z:row').each(function() {
    return true;
    Robin

  • Sometimes when I send a Pages attachment I can't open it afterwards. I get a message saying I need a newer version of Pages to open it. I find this odd since I created the document.  How can I get the attachment open?

    Sometimes when I send an email with a Pages attachment it is tuned into a zip file and then I am unable to open the atttachment afterwards.  I get a message saying I need a newer version of Pages in order to open the attachment.  How can I get around this?

    Carol,
    The message saying you need a newer version indicates that you saved from a newer version and tried to open with an older version. This has nothing directly to do with whether the file was compressed and packaged in a .zip file.
    If you have two versions of Pages on your computer, you must take care to note which of them you are using. You may want to delete a Dock alias to the older version and you may need to change the Finder preference for which version is set to automatically open .pages files.
    Jerry

  • Help with using itunes with 4s library after i upgraded to iPhone 5 and computer power supply went

    long story hopefully an easy fix....
    on wensday my power supply went and had to ship computer across country to Puget Computer Systems as we weren't sure if it was power supply or mobo...luckily it was power supply.
    i daily backed up iphone 4s with itunes (10.7) as i do all music manually, playlists, etc. have like 3,000 plus songs, videos, audiobooks, mail aaccts and about 48 apps.
    so next day (sept 19th) apple comes out with iOS 6 which i update my 4s to with no problem. I wanted a day to play with it to learn my way around.
    next day i wait in line for 8 hours overnite and was #2 in line at apple store for my ATT 32gb white iPhone 5. while at apple store I get my icloud backup which gets all paid music,apps, etc since itunes version 10.3 (i always did both backups so as not to lose my contacts more than anything.
    I have other paid stuff that is in library on computer along with audiobooks and about 2700 more songs.
    my icloud backup put the playlists on iPhone but not most of the music for them as lots were ripped from my cd's.as i double them up making a copy on iPhone and a copy on itunes.
    So I have been using iPhone 5 with no problems just don't have all of itunes library on it. My computer is coming back this week how do I plug in iPhone 5 via USB (which will be seen as new phone even though it has same name) and use my existing iTunes 10.7 library which the backups in iTunes still has iOS 5.1.1 on it?
    There must be an easy way of doing it as i don't want to wipe off iphone 5 again as i don't see any purpose my library is all organized perfectly. I know my way around windows 7 pro 64 bit pretty well just don't know what itunes is going to say once it sees "joe's iPhone" again and installs the usb drivers and icon for it. what will it ask in regards to library and how do i use it with previous iOS on it?
    Thank you very much for the help as I am going to need it.
    yes i broke the cardinal rule of cross posting and apoligize  for it just amazed i couldn't find answer via google nor any apple store genius knew it either.

    Hi All,
    Any help?
    No one has any answers here amoungst all this apple knowledge?
    Thank you

  • TS3276 When I create a new message, my icons to send and attach don't show in that message.  They do when I reply to a message.  How can I get them to show up again?

    From the message window itself, there's no way to send mail - no send arrow - and there's no paper clip icon to attach a doc.  I can do it from the menu bar, but not in the message window.  What's up?

    Hey Scrosiar,
    Thanks for the question. It sounds like the toolbar for your compose window has either been hidden, or these icons have been removed. To resolve your issue, follow these steps:
    Mail (Mavericks): Customize Mail toolbars
    http://support.apple.com/kb/PH14908
    Choose which items to include in the toolbars, and how they appear and are arranged.
    1. Display the Mail window whose toolbar you want to change.
    2. Control-click the toolbar, then choose Customize Toolbar.
    3. Drag items to and from the toolbar, and change how they appear in the toolbar.
              - When you drag an item to the toolbar, a green icon indicates you’re adding it.
              - When you drag an item from the toolbar, visual and sound effects indicate it has been removed.
              - To rearrange items, drag an item to a new location in the toolbar.
              - To change how items appear, choose an option from the Show pop-up menu.
    4. When you’re ready, click Done.
    When you resize a window, toolbar items can become hidden as the window narrows. When this happens, click the double right arrows to display a list of the hidden items.
    Thanks,
    Matt M.

Maybe you are looking for

  • Cannot delete old iPad iCloud backup "because it is in use"

    I previously owned an iPad 3 which I sold a few weeks ago. After buying an iPad Air, I restored it from the iPad 3 backup in iTunes, and now I want to delete the iCloud backup of the old iPad 3. However, when trying to delete the iCloud backup I get

  • Problem in Client Proxy

    Hi All, By using client proxy i am moving material master data into a file, i have finished IR part and activated it after that i went to R/3 side and generated the proxy and activated it . after that i have written a program in abap editor to fetch

  • Problem With Plotting a graph

    Hi, I need help plotting a graph. The situation is .... I have data of speed against time. Data is like this : a truck runs at some speed until 10 o clock. Now the driver changes time of the speed vs. time tracking device back to 9 o clock. Now if I

  • Two help menus

    Hi Everyone, I have a bit of a weird problem with Pages. I have two help menus. The second one only has Pages Help in it but it doesn't work. The other one has the origional settings and works fine. Does anyone know how to remove the second one. I wo

  • The game game category in my app store is missing, how to fix it? im using ipad 3rd generation.

    Is it me only or every one is facing this issue. i just hope my new ipad i just bought few days back has no problem. thx