none
Several list item of different lists in a single form

    Question

  • Hi,

    I'd like to know if there is a way, without using custom code (or, otherwise, the method asking the fewest code), to have a form fill multiple list at once.

    For the sake of having a simple example, let's say I have two lists, "Shape" (column : "Title") and "Points" (columns : "coordinate X", "coordinate Y", and "Shape"). A shape is made up of an undefined number of points.

    I'd want my user to complete a single form to define a shape and all of it's point like this :

    Shape Title : [___________]
    Shape Points

    Points X Y
    Point 1 [___] [___]

    [Add a row]

    I know I can design such a form in InfoPath designer, but only if I don't create a SP List form, but if I create an other type of form, I have no idea how to "wire" my fields back to the list fields or even publish my form correctly !

    Any help would be much appreciated :)


    • Edited by Zelarith Monday, January 16, 2017 10:24 AM
    Monday, January 16, 2017 10:04 AM

Answers

  • Hi Zelarith,

    To achieve this easily i see only option is doing it with custom development. As I understand your need - you want to add a shape in List1 and add points of that shape in List2. Hope this is correct?

    In that case you can build HTML in below manner - Add simple REST API calls to add list items to respective list. You have to connect Shape and Points lists as well - you can make Shape as Lookup in List2.

    Refer this MSDN forum to add list item using Javascript REST APIs. Simplest way to do it without deployment.

    Hope this helps.


    Regards Sarvesh Shinde SharePoint Developer, India

    • Marked as answer by Zelarith Monday, January 16, 2017 5:00 PM
    Monday, January 16, 2017 12:00 PM

All replies

  • Hi Zelarith,

    To achieve this easily i see only option is doing it with custom development. As I understand your need - you want to add a shape in List1 and add points of that shape in List2. Hope this is correct?

    In that case you can build HTML in below manner - Add simple REST API calls to add list items to respective list. You have to connect Shape and Points lists as well - you can make Shape as Lookup in List2.

    Refer this MSDN forum to add list item using Javascript REST APIs. Simplest way to do it without deployment.

    Hope this helps.


    Regards Sarvesh Shinde SharePoint Developer, India

    • Marked as answer by Zelarith Monday, January 16, 2017 5:00 PM
    Monday, January 16, 2017 12:00 PM
  • Hi

    create a secondary list, and add as a lookup column  a column from  from Shape list


    Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you.

    Monday, January 16, 2017 12:18 PM
  • Hi, thanks for your answer Sarvesh Shinde.
    Yes, you got it right, only there should be only one "save" button to save every filled info to the proper lists.

    Too bad we have to go through custom development when InfoPath is powerfull enough to have those quite handy "repeating tables", I guess I'll just build the form using InfoPath and then edit the code so that the form will do what I want it to.


    • Edited by Zelarith Tuesday, January 17, 2017 9:20 AM
    Monday, January 16, 2017 5:00 PM
  • Romeo Donca, this isn't solving the issue, as you have to complete several forms, I'd like my user to only have one form to go through since those points are parts of one and only one shape, it doesn't make sense for them to fill forms one after the other.

    But thanks for your time reading / answering :)



    • Edited by Zelarith Tuesday, January 17, 2017 9:21 AM
    Monday, January 16, 2017 5:02 PM
  • I purposefully added two save buttons - as we have to use Shape as Lookup in Points list. Unless you save Shape item you cant save Points items. Or else even you can remove the save button then you have to handle it completely from script.

    Yes I understand it will be easy from IP forms with repeating tables. Give it a try.


    Regards Sarvesh Shinde SharePoint Developer, India

    Tuesday, January 17, 2017 10:50 AM