Hello destery.
I can’t share the studio file but here is the script applied to a .png plane (acting as a button)
It works ok, a series of promps appear on the device asking the below questions. These are held in an array and uploaded as an event on the last question submission. This was just me testing to see if I could achieve it. I’ve tested on both iOS and android. It works. Not sure how well it would work once legal Ts&Cs are applied though!
You can then review the captured data via the specific event analytics.
//-------------------------------------------
//Array to hold data
var myArray = [“undefined”,“undefined”,“undefined”];
//-------------------------------------------------------
//-------------------------------------------------------
//Questions and Text are added here
var myprompt = Z.Prompt({
title: “T&Cs”,
text: “All rights reserved. This questionnaire or any portion thereof may not be reproduced or used in any manner whatsoever without the express written permission of the publisher.”,
//defaultValue: “Press OK or ENTER to continue or CANCEL”,
//maxLength: 15,
//filterProfanity: true
});
var myprompt2 = Z.Prompt({
title: “Survey Form”,
text: “Please enter your name:”,
defaultValue: “Type name here”,
maxLength: 15,
filterProfanity: true
});
var myprompt3 = Z.Prompt({
title: “Email Address”,
text: “Please enter your email address:”,
defaultValue: "you@mydomain.com",
maxLength: 30,
filterProfanity: true
});
var myprompt4 = Z.Prompt({
title: “Device Platform”,
text: “What type of device did you use to view this zap?:”,
defaultValue: “iOS or Android”,
maxLength: 30,
filterProfanity: true
});
//-----------------------------------
//If cancel button is pressed
var myprompt5 = Z.Prompt({
title: “Thank You, you answers have been submitted”,
});
//-------------------------------------------------------
//-------------------------------------------------------
//On user click, display prompt
parent.on(“pointerdown”, (e) => {
// Runs when pointerdown occurs on the parent node
// The argument e contains useful info about this event:
// https://docs.zap.works/studio/scripting/reference/object/events/pointerdown/
myprompt.show();
});
//-------------------------------------------------------
//-------------------------------------------------------
//Capture questions and store in Array
myprompt.on(“confirm”, function(theirEntry : string) {
//myArray[0] = ("Name: " + theirEntry);
myprompt2.show();
});
myprompt2.on(“confirm”, function(theirEntry : string) {
myArray[0] = ("Name: " + theirEntry);
myprompt3.show();
});
myprompt3.on(“confirm”, function(theirEntry : string) {
myArray[1] = ("Email: " + theirEntry);
myprompt4.show();
});
//LAST QUESTION sends capture to analytics site
myprompt4.on(“confirm”, function(theirEntry : string) {
myArray[2] = ("Device Platform: " + theirEntry);
Z.stats.logEvent("Details: " + myArray);
myprompt5.show();
});
myprompt.on(“cancel”, function() {
console.log(“They cancelled the dialog :-(”);
});