You are viewing limited content. For full access, please sign in.

Question

Question

Script for add fields programmatically.

asked on February 22, 2018

Does anyone know if there's a way to script adding fields in LF?  I have over 50 fields i need to create and scripting if would probably be the quickest way.

0 0

Replies

replied on February 22, 2018

I don't know of any scripts that will do this, but if you build a base form as a starting point and download it to your machine it can be view as XML. Once you have an idea of the structure you could probably add additional fields without much difficulty then re-import it back into Forms as a new process.

However, it might end up being more work than just creating the fields because you would need to figure out what the different attributes do and how they should be configured.

Below is an example of what a Field object looks like when you get the XML for a Forms process.

<field>
    <formId>1491</formId>
    <fieldId>1</fieldId>
    <position>0</position>
    <label>Test Field</label>
    <subLabel i:nil="true" />
    <helpText i:nil="true" />
    <tooltip i:nil="true" />
    <type>text</type>
    <isRequired>false</isRequired>
    <isUnique>false</isUnique>
    <size>50</size>
    <length i:nil="true" />
    <cols i:nil="true" />
    <rows i:nil="true" />
    <defaultvalue />
    <format i:nil="true" />
    <rangeType i:nil="true" />
    <rangeMin i:nil="true" />
    <rangeMax i:nil="true" />
    <layout i:nil="true" />
    <choices>[]</choices>
    <subfields i:nil="true" />
    <classNames i:nil="true" />
    <isReadonly>false</isReadonly>
    <useVal>false</useVal>
    <isDigits>false</isDigits>
    <isAllowOther>false</isAllowOther>
    <otherChoice i:nil="true" />
    <customFieldName i:nil="true" />
    <validationPattern i:nil="true" />
    <optionLabel i:nil="true" />
    <optionLabelex i:nil="true" />
    <isRepeatable>false</isRepeatable>
    <attributeId>10083</attributeId>
    <lookupPopulatedParentList />
    <fileExtension i:nil="true" />
    <fileMaxSize i:nil="true" />
    <currencyFormat i:nil="true" />
    <isUserInSummary>false</isUserInSummary>
    <belongToForms xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
    <loadDefaultSignature>false</loadDefaultSignature>
    <memberId>9999</memberId>
    <memberPath>9999</memberPath>
    <memberName>Test_Field</memberName>
    <attributeType>text</attributeType>
    <isPreviousDataPreserved>false</isPreviousDataPreserved>
    <isSeparatorEnabled>false</isSeparatorEnabled>
    <maxDecimalPlaces i:nil="true" />
    <hideSectionLabel>false</hideSectionLabel>
    <showtime>false</showtime>
    <allowQR>false</allowQR>
    <appendChoices>false</appendChoices>
  </field>

 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.