I Currently have an app that is not deployed, so I know that workflows are not triggered.
But they can still be tested, right? They should still send data when โtestedโ as described below?
I am developing a workflow that sends a JSON payload to an appscript (a stand alone web app), whose function (at the moment) is solely to show me the JSON object in an email.
So if I โtestโ a workflow, I get a page with all the possible results (the data I expect shows up - example at the end). I can โsendโ one example and it indeed makes the appscript do its job and I receive an email. (so the appscript URL is correct).
(I use email to report the results as the โLoggerโ function appears to not record anything from a stand alone web app.)
In the workflow, I have the โverbโ set to โPostโ and โHTTP contentโ set to โJSONโ
There are no headers and the body template is (for all practical purposes I let Appsheet generate it)
{
โEventโ: โ<<[Event]>>โ,
โStart Dateโ: โ<<[Start Date]>>โ,
โEnd Dateโ: โ<<[End Date]>>โ,
โsitter addressโ: โ<<[sitter address]>>โ,
โemail listโ: โ<<[email list]>>โ,
โDogโ: โ<<[Dog]>>โ,
โSitterโ: โ<<[Sitter]>>โ,
}
my appscript is
function doPost(e) {
var data = e.parameter
MailApp.sendEmail({
to: โmyemailโ,
subject: โresults logโ,
htmlBody: โlog eventsโ + data + e.parameter })
}
and the body of the resulting email is
log events [object][object][object][object]
Essentially a blank set of data. Does not โeโ contain the object?
if not, how do I obtain the JSON object so that I can parse the data sent to the appscript.
If this is not a valid method to test the workflow - is there a way without deploying itโฆ yet.
an example of the โRule Actionโ from the โtest pageโ with PII removed.
{
โ$typeโ: โNirvana.Data.WorkflowActionResultWebhook, V2APIโ,
โHeadersโ: {
โ$typeโ: โSystem.Collections.Generic.Dictionary`2[[System.String, mscorlib],[System.String, mscorlib]], mscorlibโ
},
โPayloadโ: โ{โEventโ: โHonor Sits with Leitchโ,โStart Dateโ: โ4/16/2019โ,โEnd Dateโ: โ4/20/2019โ,โsitter addressโ: โ414 XXXXXXXXXX3, USAโ,โemail listโ: โemail1 , email2โ,โDogโ: โ1016โ,โSitterโ: โ1018โ,}โ,
โUrlโ: โhttps://script.google.com/macros/s/AKfycbyPQFC6A_jcvPOXIrEvi7OIPHZ6vP0shIkQKWze6Op1kUvXmWTs/execโ,
โVerbโ: โPostโ,
โMimeTypeโ: โapplication/jsonโ,
โTimeoutSecondsโ: 180,
โMaxRetryCountโ: 3,
โAsyncExecโ: false
}
@DaveR, you need to use e.postData.contents rather than e.parameter. See this - https://developers.google.com/apps-script/guides/web
Yeah. OK - that is where I started, because it made more sense, but it would not even run.
Obviously, I had another issue(s) that caused it to failโฆ
Thank you for your prompt reply!!
User | Count |
---|---|
25 | |
24 | |
24 | |
20 | |
16 |