cross-posted on the Wolfram Community forum
I am trying to deploy a ScheduledTask
that monitors the state of a google spread sheet every hour. I want the object to display the content (which should be static), but instead upon deployment, it creates an object which redirects me to a notepad in my Wolfram Development Platform account that allows me to add information (but cannot execute). 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:
Clear@obj
obj = ScheduledTask[{Now, csv}, "Hourly"](*creates a scheduled task that monitors the information in the doc every hour*)//
CloudDeploy[#, Permissions -> "Public"] &
Again, this results in a redirect to my development platform account (that is only accessible to me and not anyone else) and not to a static web object which displays the contents of the google doc. I am pretty new to using the Wolfram Cloud, but it feels a lot 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?
Update: I've tried including the line of code before CloudDeploy
of RunScheduledTask[#]&
as well as StartScheduledTask[#]&
. When deployed, this results in a static web object like I'd wanted, but the former gives me this, and the latter gives me this. Again, I don't like that I can't really see what's going on in the Cloud that results in it failing.