Hi, all
I am trying to deploy a ScheduledTask
that monitors the state of a google spread sheet every hour. I want the cloud object to display the contents of the csv file that I am monitoring. Here is a look at my code:
This imports the contents of the google doc:
Clear@url
Clear@csv
(url = "https://path-to-google-doc/export?format=csv") //
Import[#, "CSV", CharacterEncoding -> "UTF8"] & //
Flatten@# & //
(csv = #) & //
Dataset@# &
Which results in an output that takes the form: Dataset[{....}]
.
To create the ScheduledTask, I have tried both:
Clear@obj
obj = ScheduledTask[{Now, csv}, "Hourly"](*creates a scheduled task that monitors the information in the doc every hour*)//
RunScheduledTask[#]& //
CloudDeploy[#, Permissions -> "Public"] &
and
Clear@obj
obj = ScheduledTask[{Now, csv}, "Hourly"](*creates a scheduled task that monitors the information in the doc every hour*)//
StartScheduledTask[#]& //
CloudDeploy[#, Permissions -> "Public"] &
The former returns this, and the latter gives me this. I am pretty new to using the Wolfram Cloud so extensively, but it's more and more beginning to feel like a black box, which makes debugging pretty difficult because I am never sure where the issue truly lies; my thought is to wrap the scheduled task in an APIFunction
, but I am not sure how to go about doing that, since there is no specific association I am looking to make for the information in the csv file. Is this the right way to go about this? How can I utilize APIFunction
if I don't have an explicit set of rules I am looking to make and how is the Cloud processing all of the information I am attempting to send it?