1 Reply Latest reply: Jan 25, 2013 4:40 AM by Gysbert Wassenaar RSS

    Create a new field with data in script

      Hi All,

       

      Is there a way to create a new field with data values in them in the Script? 

       

      My example is this.  I have 3 lists (sharepoint. List 1, List 2, list 3) being pulled.  List 1 is the main List that has a Legal name as the key field.  List 2 and 3 all are linked via the Legal Name.  I also have a field in the lists called Title Name that basically tells me which list i am pulling from, be it List 2 or List 3 yet list 1 does not have this field.  How can I combine the Title lists in List 2 and 3 into list 1? Or combine the lists all together so I can click and sort by them.  If I change all the Title Lists to the same field name it becomes another key field which i do not want to do.

       

      Any help is greatly appreciated.

       

      Nick

        • Re: Create a new field with data in script
          Gysbert Wassenaar

          It depends on your data and what you want. You can join the list tables or maybe you can use mapping tables and the applymap function.

           

          You could use the join statement to join the tables into one table. You can then use the fields in the combined table to create new fields. Something like this:

           

          List1:

          Load

          LegalName, fieldB, fieldC, ..etc

          from ...list1...;

           

          join

          Load

          LegalName, fieldP, fieldQ, ..etc

          from ...list2...;

           

          join

          Load

          LegalName, fieldX, fieldY, ..etc

          from ...list3...;

           

          ResultTable:

          Load

          LegalName,

          fieldP & '-' & fieldX as fieldPX,

          fieldA, fieldB, fieldP,...etc

          resident List1;

           

          drop table List1;