How Can We Help?

Search for answers or browse about Sintel Forms.

Automatically add linked items or files

You are here:

You can automatically add linked items or files to a new form using a custom js step within the Logic screen.

Here is an example of a function to do this.

insertSublistItems('internal Linked List name', [
 { Internal field name: 'value', 
   Internal field name: 'value' 
}])

 

  1. We do not recommend changing system fields.
  2. Make sure that steps and conditions that you create do not create an infinite loop, you should ensure that adding new items/files is stopped at some point.
  3. If from some reason during saving an error occurs (caused by invalid data in the sublist for example) – the main form and other sublists will be saved – unless they are invalid too.

 

Example

Here are examples of the various field types and how to set their values:

 

    1. Single line

       

      SingleLine: 'First Image',

       

    2. Multi-line

       

      MultiLine: 'Three\nline\ntext',

       

      For multi-line rich text fields, you should use HTML syntax.

       

    3. Number

       

      Number: '7.5',

       

    4. Yes/No

       

      YesNo: '1',

       

      ‘Yes’ = 1, ‘No’ = 0

       

    5. Date and time / Date

       

      DateTime: new Date(2019, 5, 1, 6, 30), 
      Date: Date.now(),

       

      Remember that months in JS are indexed from 0. So DateTime: new Date(2019, 5, 1), will give you 2019/06/01 i.e. January is 0.

       

    6. Person/Group

       

      PersonGroup: ['groupSite Owners'], 
      PersonMulti: ['slawek@sintel.ie', 'piotr@sintel.ie'],

       

      The SharePoint group must exist, and the user must have permissions to access the group, otherwise, the record will be invalid and won’t save.

       

    7. Choice

       

      Dropdown: 'Choice 1', 
      Checkbox: ['Choice 1','Choice 2'], 
      Radiobutton: 'Choice 3',

       

    8. Hyperlink/Picture

       

      Hyperlink: { url: 'https://twistedsifter.files.wordpress.com/2012/03/hover-cat-flying-cat-2.jpg?w=640&h=447', description: 'cat' }, 
      Picture: { url: 'https://apod.nasa.gov/apod/image/1901/MeteorMountain_Roemmelt_1371.jpg', description: 'space' },

       

    9. File (Document/Picture Library Linked List)

       

      File: { Name: 'hover-cat-flying-cat-2.jpg', Url: 'https://twistedsifter.files.wordpress.com/2012/03/hover-cat-flying-cat-2.jpg?w=640&h=447' },

       

      If the link will be invalid for some reason the whole row won’t be added – be sure to check the given URL.

       

    10. Lookup

       

      Lookup: '1',

       

      The given number is an index of a list item from within the Linked List.

 

There are also two additional properties available:

notEditable: 'true',
notDeletable: 'true',

As the name suggests the first property causes that newly added items are not editable, the second property controls whether the items are deletable – this only applies to rows added via the insertSublistItems function

In the examples above the ‘true’ statement is redundant, it is only added to improve readability. Changing this to ‘false’ does not change the property so if you want newly added row(s) to be editable simply delete the notEditable property.

 

These properties only apply to linked items or files added to a new form using a custom js step within the Logic screen.

 

Example

 

 

Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents