{"_id":"5a6b684793313c005b692e24","category":{"_id":"5a6b684793313c005b692e0a","version":"5a6b684793313c005b692e07","project":"57c87ef85754fa1700b1228d","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-11-05T21:53:37.386Z","from_sync":false,"order":2,"slug":"reference","title":"Reference"},"parentDoc":null,"project":"57c87ef85754fa1700b1228d","user":"57c73a03e6935b1700b15115","version":{"_id":"5a6b684793313c005b692e07","project":"57c87ef85754fa1700b1228d","__v":1,"createdAt":"2018-01-26T17:41:27.297Z","releaseDate":"2018-01-26T17:41:27.297Z","categories":["5a6b684793313c005b692e08","5a6b684793313c005b692e09","5a6b684793313c005b692e0a","5a6b684793313c005b692e0b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.5.3","version":"3.5.3"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-17T22:47:48.953Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":19,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Fields Submission\"\n}\n[/block]\nIf you would like to do something custom with the data while in a Flow, you can take advantage of the 'Submit Fields' action in the Visual Editor. This action will simply hand over all of the input values thus far in the Flow. To get this data, you should override the 'handleFields(Map)' method in the Primer Activity. You are free to do what you wish with this data, such as start another activity passing along the data (ex 'startActivityForResult'). \n\nWhen you are finished processing the data, you should call one of the following methods on the Activity to continue with the Primer flow. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"void fieldsHandled(boolean success);\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nYou should call the 'fieldsHandled' method after you are finished processing the fields from the 'Submit Fields' action. The boolean parameter is whether or not the SDK should advance to the next screen. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"void fieldsHandledAdvanceToScreen(String screenName, boolean clearBackStack, boolean animateEnter);\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nYou alternatively can call the 'fieldsHandledAdvanceToScreen' method to skip to a specific screen in the Flow after the fields have been submitted. This method can take in a name of a screen that is later in the flow. You can also configure whether or not you want to clear the back stack of existing Views once the new View is added. (If the user presses back after this, they will leave the activity). The last parameter is a boolean which defines if the new View should be animated when it becomes visible.","excerpt":"","slug":"customize-implementation","type":"basic","title":"Custom Flow Logic"}
[block:api-header] { "type": "basic", "title": "Fields Submission" } [/block] If you would like to do something custom with the data while in a Flow, you can take advantage of the 'Submit Fields' action in the Visual Editor. This action will simply hand over all of the input values thus far in the Flow. To get this data, you should override the 'handleFields(Map)' method in the Primer Activity. You are free to do what you wish with this data, such as start another activity passing along the data (ex 'startActivityForResult'). When you are finished processing the data, you should call one of the following methods on the Activity to continue with the Primer flow. [block:code] { "codes": [ { "code": "void fieldsHandled(boolean success);", "language": "java" } ] } [/block] You should call the 'fieldsHandled' method after you are finished processing the fields from the 'Submit Fields' action. The boolean parameter is whether or not the SDK should advance to the next screen. [block:code] { "codes": [ { "code": "void fieldsHandledAdvanceToScreen(String screenName, boolean clearBackStack, boolean animateEnter);", "language": "java" } ] } [/block] You alternatively can call the 'fieldsHandledAdvanceToScreen' method to skip to a specific screen in the Flow after the fields have been submitted. This method can take in a name of a screen that is later in the flow. You can also configure whether or not you want to clear the back stack of existing Views once the new View is added. (If the user presses back after this, they will leave the activity). The last parameter is a boolean which defines if the new View should be animated when it becomes visible.