{"id":25982,"date":"2017-10-05T11:32:01","date_gmt":"2017-10-05T10:32:01","guid":{"rendered":"https:\/\/www.snapsurveys.com\/support-snap11\/?page_id=25982"},"modified":"2023-05-12T13:40:12","modified_gmt":"2023-05-12T12:40:12","slug":"using-survey-link-to-seed-data-into-your-survey","status":"publish","type":"page","link":"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/","title":{"rendered":"Using the survey link to seed data into your survey"},"content":{"rendered":"<p>If you are providing a link to your survey and want to&nbsp;seed data directly into the variables, you can create the link required using the tool below.<\/p>\n<p>Examples of when you might want to do this are:<\/p>\n<ul>\n<li>Example 1 &#8211; you are sending email invites using your own system &#8211;&nbsp;the tool will help create the structure of the link<\/li>\n<li>Example 2 &#8211; you want to add an identifier (name of a ward, location, media type, etc.). This could be used in conjunction with our <a href=\"https:\/\/www.snapsurveys.com\/resources\/free-qr-code-generator\/\" target=\"_blank\" rel=\"noopener\">QR Code Generator <\/a><\/li>\n<\/ul>\n<p>You&nbsp;can seed:<\/p>\n<ul>\n<li>A&nbsp;coded variable by entering the code number <i class=\"fa fa-question-circle\" aria-hidden=\"true\"><\/i>. If you wish to set multiple codes, separate the code numbers with a semi-colon, e.g. 4;7.<\/li>\n<li>An&nbsp;open ended question by entering the words e.g. Ward A<\/li>\n<\/ul>\n<p>When you are seeding any special characters they will be encoded, see <a href=\"https:\/\/www.snapsurveys.com\/help\/index.htm#22956\" target=\"_blank\" rel=\"noopener\">Help page<\/a> for more information.<\/p>\n<h2>Tool to create a link with seeding<\/h2>\n\r\n\t<!--Pull in angularjs resource-->\r\n\t<script src=\"https:\/\/www.snapsurveys.com\/wp-content\/plugins\/seedVarURL\/angular.min.js\"><\/script>\r\n\t<script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/angularjs\/1.6.4\/angular.min.js\"><\/script>\r\n\t<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/clipboard@1\/dist\/clipboard.min.js\"><\/script>\r\n\r\n\t<!--START APP-->\r\n\t<div ng-app=\"seedURLApp\" ng-controller=\"seedURLCtrl\" class=\"app-wrap\">\r\n\t\r\n\t\t\r\n\t\t<!--Seed URL Form-->\r\n\t\t<form name=\"form\" novalidate>\r\n\t\t\t<!--URL of second survey-->\r\n\t\t\t<label for=\"survey\">Survey link from Snap WebHost <br>(i.e. https:\/\/www.snapsurveys.com\/wh\/?k=111111111111) <\/label>\r\n\t\t\t<input name=\"survey\" id=\"survey\" value=\"\" ng-model=\"URL\" size=\"30\" type=\"url\" ng-pattern=\"kNumCheck\"  required>\r\n\t\t\t<span ng-show=\"form.survey.$invalid && form.survey.$dirty\" class=\"error\">Please enter a valid survey link<\/span>\r\n\t\t\t<div>\r\n\t\t\t\t<label for=\"numVars\">How many variables do you wish to seed?<\/label>\r\n\t\t\t\t<input name=\"numVars\" id=\"numVars\" value=\"\" ng-change=\"repeatFunc()\" ng-model=\"numVars\" size=\"2\" type=\"number\" min=\"0\" max=\"20\">\r\n\t\t\t\t<span ng-show=\"form.numVars.$invalid\" class=\"error\">Please enter a number between 1 and 20<\/span>\r\n\t\t\t<\/div>\r\n\t\t\t<!--START LOOP through numVars-->\r\n\t\t\t<div ng-repeat=\" x in varsToSeed\">\r\n\t\t\t\t<label for=\"txt1\">Name of variable in the survey (i.e. Q1)<\/label>\r\n\t\t\t\t<input name=\"txt1\"  ng-model=\"x.toName\" size=\"5\" type=\"text\" ng-change=\"hideURL()\">\r\n\t\t\t\t<label for=\"txt2\">The data you want to send to the variable (i.e. a single code, multiple codes or text)<\/label>\r\n\t\t\t\t<input name=\"txt2\"  ng-model=\"x.fromName\" size=\"5\" type=\"text\" ng-change=\"hideURL()\">\r\n\t\t\t\t\r\n\t\t\t<\/div>\r\n\t\t\t<!--END LOOOP-->\r\n\t\t\t<button ng-click=\"setURL()\" ng-disabled=\"form.survey.$invalid || form.numVars.$pristine\" class=\"button\" >Create my url with seeding<\/button>\r\n\t\t<\/form>\r\n\r\n<p id=\"seedLink\" ng-show=\"activeCopy\" class=\"url\">{{loopURL}} <i class=\"fa fa-check check\" aria-hidden=\"true\"><\/i><\/p>\r\n\t\t<button id=\"copy\" class=\"btn button\" data-clipboard-text=\"{{loopURL}}\" ng-show=\"activeCopy\"><i class=\"fa fa-clipboard\" aria-hidden=\"true\"><\/i>Copy URL<\/button>\r\n\r\n\t\t<script>\r\n\t\t\tangular.module(\"seedURLApp\", []).controller(\"seedURLCtrl\", function($scope) {\r\n\t\t\t\t\/*Declare array*\/\r\n\t\t\t\t$scope.varsToSeed = [];\r\n\t\t\t\t\r\n\t\t\t\t\/*Declare K Num pattern*\/\r\n\t\t\t\t$scope.kNumCheck = \"[a-z0-9._%+-\/:]+[?]+k=+[0-9]{12}\";\r\n\t\t\t\t\r\n\t\t\t\t\/*Declare copy status*\/\r\n\t\t\t\tvar checkCopy = \"\";\r\n\t\t\t\t$scope.copySucc = checkCopy;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\/*Create array each time numVars value has change*\/\r\n\t\t\t\t$scope.repeatFunc = function () {\r\n\t\t\t\t\t$scope.varsToSeed = [];\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (i=0; i < $scope.numVars; i++) {\r\n\t\t\t\t\t\tvar newNumVar = {num: [i], fromName: \"\", toName: \"\"};\r\n\t\t\t\t\t\t$scope.varsToSeed.push(newNumVar);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t\/*Create URL on button click*\/\r\n\t\t\t\t$scope.setURL = function() {\r\n\t\t\t\t\t$scope.seedingURL = $scope.URL;\r\n\t\t\t\t\t$scope.activeCopy = true;\r\n\t\t\t\t\tif($(\"#seedLink\").hasClass(\"copied\")){\r\n   \t\t\t\t\t\t$(\"#seedLink\").removeClass(\"copied\")\r\n\t\t\t\t\t};\r\n\t\t\t\t\t$scope.loopURL = encodeURI($scope.seedingURL);\r\n\t\t\t\t\t\/*Loop through each object in varToSeed array*\/\r\n\t\t\t\t\tfor (i=0; i < $scope.numVars; i++) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\/*Change paradata vars to URL vars*\/\r\n\t\t\t\t\t\t$scope.displayFrom = $scope.varsToSeed[i].fromName;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($scope.varsToSeed[i].toName == \"id.name\" || $scope.varsToSeed[i].toName == \"ID.name\") {\r\n\t\t\t\t\t\t\t$scope.displayTo = \"u\";\r\n\t\t\t\t\t\t}else if ($scope.varsToSeed[i].toName == \"id.password\" || $scope.varsToSeed[i].toName == \"ID.password\") {\r\n\t\t\t\t\t\t\t$scope.displayTo = \"p\";\r\n\t\t\t\t\t\t}else if ($scope.varsToSeed[i].toName == \"id.site\" || $scope.varsToSeed[i].toName == \"ID.site\") {\r\n\t\t\t\t\t\t\t$scope.displayTo = \"s\";\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t$scope.displayTo = $scope.varsToSeed[i].toName;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\/*Encode URL*\/\r\n\t\t\t\t\t\t\t$scope.loopURL = $scope.loopURL + \"&\" + encodeURIComponent($scope.displayTo) + \"=\" + encodeURIComponent($scope.displayFrom);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\t\/*Hide on change*\/\r\n\t\t\t\t$scope.hideURL = function () {\r\n\t\t\t\t\t$scope.activeCopy = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\/*Copy Output*\/\r\n\t\t\t\tvar clipboard = new Clipboard(\".btn\");\r\n\t\t\t\t    clipboard.on('success', function(e) {\r\n\t\t\t\t\t\tconsole.log(e);\r\n\t\t\t\t\t\t\/*Declare a back color*\/\r\n\t\t\t\t\t\t$(\"#seedLink\").addClass(\"copied\");\r\n\t\t\t\t\t\tconsole.log(\"should be green\");\r\n\t\t\t\t\t});\r\n\t\t\t\t\tclipboard.on('error', function(e) {\r\n\t\t\t\t\t\tconsole.log(e);\r\n\t\t\t\t\t\t\/*Declare a back color*\/\r\n\t\t\t\t\t\tdocument.getElementById(\"seedLink\").style.backgroundColor = \"red\";\r\n\t\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t\r\n\t\t<\/script>\r\n\t<\/div>\n","protected":false},"excerpt":{"rendered":"<p><a class=\"ninja_pages_read_more\"  href=\"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/\"><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":{"0":"post-25982","1":"page","2":"type-page","3":"status-publish","5":"search_category-support-hub"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using the survey link to seed data into your survey - Snap Surveys<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the survey link to seed data into your survey - Snap Surveys\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/\" \/>\n<meta property=\"og:site_name\" content=\"Snap Surveys\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/SnapSurveys\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-12T12:40:12+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@snapsurveys\" \/>\n<meta name=\"twitter:label1\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/\",\"name\":\"Using the survey link to seed data into your survey - Snap Surveys\",\"isPartOf\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/#website\"},\"datePublished\":\"2017-10-05T10:32:01+00:00\",\"dateModified\":\"2023-05-12T12:40:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.snapsurveys.com\/support-snap11\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using the survey link to seed data into your survey\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.snapsurveys.com\/support-snap11\/#website\",\"url\":\"https:\/\/www.snapsurveys.com\/support-snap11\/\",\"name\":\"Snap Surveys\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.snapsurveys.com\/support-snap11\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the survey link to seed data into your survey - Snap Surveys","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_GB","og_type":"article","og_title":"Using the survey link to seed data into your survey - Snap Surveys","og_url":"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/","og_site_name":"Snap Surveys","article_publisher":"https:\/\/www.facebook.com\/SnapSurveys","article_modified_time":"2023-05-12T12:40:12+00:00","twitter_card":"summary_large_image","twitter_site":"@snapsurveys","twitter_misc":{"Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/","url":"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/","name":"Using the survey link to seed data into your survey - Snap Surveys","isPartOf":{"@id":"https:\/\/www.snapsurveys.com\/support-snap11\/#website"},"datePublished":"2017-10-05T10:32:01+00:00","dateModified":"2023-05-12T12:40:12+00:00","breadcrumb":{"@id":"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/using-survey-link-to-seed-data-into-your-survey\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.snapsurveys.com\/support-snap11\/"},{"@type":"ListItem","position":2,"name":"Using the survey link to seed data into your survey"}]},{"@type":"WebSite","@id":"https:\/\/www.snapsurveys.com\/support-snap11\/#website","url":"https:\/\/www.snapsurveys.com\/support-snap11\/","name":"Snap Surveys","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.snapsurveys.com\/support-snap11\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"}]}},"_links":{"self":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/25982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/comments?post=25982"}],"version-history":[{"count":9,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/25982\/revisions"}],"predecessor-version":[{"id":31767,"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/pages\/25982\/revisions\/31767"}],"wp:attachment":[{"href":"https:\/\/www.snapsurveys.com\/support-snap11\/wp-json\/wp\/v2\/media?parent=25982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}