InboundValues - smbc-digital/form-builder GitHub Wiki

When to use inbound values and what is it?

Inbound values is used when data from an external source will be provided to formbuilder on a POST or GET action, This allows us to map the inbound values to a related field.

Inbound values can be run on both GET to be retrieved from the query string or on POST and retrieved from the form data. This is specified via the required HttpActionType.

Property Type Required Default Value Description
IncomingValues object[] ✔️ List of inbound values the page accepts

IncomingValues

Property Type Required Default Value Description
QuestionId string ✔️ QuestionId inbound value is being mapped to
Name string ✔️ id of inbound value
HttpActionType enum ✔️ Unknown Http action type the value will be retrieved on. This is either GET or POST
Base64Encoded bool false Specifies if the value to be retrieved is base64Encoded
Optional bool false specifies if the inbound value is optional

HttpActionType

    public enum HttpActionType
    {
        Unknown = 0,
        Get,
        Post
    }

FormJson Example:

{
    "FormName": "Full Journey of Elements",
    "Pages": [
        {
            "Title": "page1",
            "PageSlug": "page-one",
            "Elements": [],
            "Behaviours": [],
            "IncomingValues": [
                {
                    "QuestionId": "map.lat",
                    "Name": "lng",
                    "HttpActionType": "Post"
                },
                {
                    "QuestionId": "map.lng",
                    "Name": "lat",
                    "HttpActionType": "Post"
                },
	        {
		    "QuestionId": "ref",
                    "Name": "ref",
                    "HttpActionType": "Get",
                    "Base64Encoded": true
	        }
            ]
        }
    ]
}