Version 8

    Sample form templates used by the Forms App.

     

    Add "fbldr_templates_sample" to the list of tags in the app options to utilize these templates.

     

    Note:  These templates do not specify a location in which to post their content.  In the app settings, set the default location to a Community or Social Group.

     

    settings01.png

     

     

    Sample Templates

     

    The following samples can be used for reference when creating form templates.

     

     

    ABC Template

         {
            "category": "My Templates",
            "name": "ABC Template",
            "desc": "This is a template that I use to record stuff.",
            "fields": [
                { "type": "userpicker", "id": "who", "label": "Who", "required": true },
                { "type": "text", "id": "what", "label": "What", "value": "this is what" },
                { "type": "text", "id": "why", "label": "Why", "value": "this is why" },
                { "type": "text", "id": "where", "label": "Where", "value": "this is where" },
                { "type": "date", "id": "when", "label": "When", "title": "Pick a date, any date." },
                { "type": "textarea", "id": "how", "label": "How", "value": "this is how" },
                { "type": "text", "id": "quantity", "label": "How Many", "value": "this is how many", "title": "Must be a number", "patterns": ["\\d+"] },
                { "type": "boolean", "id": "like", "label": "Like", "value": true }
            ],
            "content": {
                "type": "document",
                "title": "A {$what} is Happening",
                "body": "<body><div><h4>For</h4>{$who}</div><div><h4>{$why.label}</h4><span>{$why}</span></div><div><h4>{$where.label}</h4><span>{$where}</span></div><div><h4>{$when.label}</h4><span>{$when}</span></div><div><h4>{$how.label}</h4><span>{$how}</span></div><div><h4>Liked?</h4><span>{$like}</span></div></body>"
            }
        }
    

     

     

    A Template

         {
            "category": "My Templates",
            "name": "A Template",
            "desc": "This is a template that I use to do stuff.",
            "fields": [
                { "type": "text", "id": "firstName", "label": "First Name", "required": true },
                { "type": "text", "id": "lastName", "label": "Last Name", "required": true },
                { "type": "text", "id": "email", "label": "Email" },
                { "type": "text", "id": "phone", "label": "Phone" },
                { "type": "text", "id": "ipaddr", "label": "IP Address", "title": "A valid IP address (ex: 192.168.1.1)", "patterns": ["\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}"], "patternError": "valid IP address" },
                { "type": "select", "id": "contact", "label": "Best Contact", "values": [{"value":"immediately","label":"Now"}, {"value":"soon","label":"Later"},{"value":"future","label":"Never"}], "value": "future" },
                { "type": "textarea", "id": "notes", "label": "Notes" }
            ],
            "content": {
                "type": "question",
                "title": "A Question Title",
                "body": "<body>Question Body</body>"
            }
        }
    

     

     

    Message Template

         {
            "category": "Your Templates",
            "name": "Message Template",
            "desc": "This is a template that I use to message stuff.",
            "fields": [
                { "type": "text", "id": "msgTo", "label": "To", "required": true, "title": "Who are you sending this to?" },
                { "type": "text", "id": "msgFrom", "label": "From", "required": true, "title": "This should be you." },
                { "type": "userselect", "id": "msgCopy", "label": "CC", "required": true, "values": [{"value":"3218,3378","label":"Developers"},{"value":"3218","label":"Fernando"},{"value":"3378","label":"Monte"}] },
                { "type": "text", "id": "msgSubj", "label": "Subject", "required": true, "title": "What is this regarding?" },
                { "type": "textarea", "id": "msgBody", "label": "Message", "title": "This is the body of your message." },
                { "type": "select", "id": "msgSend", "label": "Send Via", "values": ["Email", "IM", "Text"], "required": true  }
            ],
            "content": {
                "type": "discussion",
                "docId": 69936
            }
        }