-
|
A followup bucket question. I have a list of data I can format as a json file (a list of filenames). I'd like to push those into a bucket, and be able to use them in a second event as a menu (example, to select a file to apply, based on a list i've generated in the previous event). I initially thought I'd get there by writing a json file into the bucket .. but that's not at all how the bucket menu gets it's data. Is there an example of how to write bucket data from the shell plugin? I've taken a look, but I wasn't able to find my way to an answer. Thanks for your patience. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Well, I am missing a lot of details about your situation, but it sounds like you want to output "data" from your job, and then upload that data into a bucket. Then you can use the bucket data as a source to populate a menu. Here are the steps: In your job script, output data like this: echo '{ "xy":1, "data":{ "menu_items":["Item 1", "Item 2", "Item 3"] } }'The Next, run your job and confirm that you can see the output data formatted nicely in the job details screen upon completion:
Then configure a Store Bucket action on job completion or job success to upload the data (not files) to a bucket:
Next, run the job again. This time, make sure you see the data output as before, but also, you see a successful Store Bucket action, like this:
Next, click on "Buckets" in the sidebar and edit your bucket, then click "Edit JSON..." to make sure the data made it into your bucket. You should see something like:
Now the bucket is ready to use as a menu source. Create a new event (or edit an existing one if you have one made already), and click "New Param". From the "Control Type" menu, select "Bucket Menu", and then select the bucket you stored the data in:
Now, here is the really important part. You need to make sure that the "Data Path" contains a proper "dot.delimited" JSON path to the array of items you stored inside the bucket. In this case the array is a top-level property named
Then your user field should be ready to use:
When you run the event, you should see the drop-down menu in the "User Parameters" section, populated with the items we added from our job:
Hope this makes sense! |
Beta Was this translation helpful? Give feedback.








Well, I am missing a lot of details about your situation, but it sounds like you want to output "data" from your job, and then upload that data into a bucket. Then you can use the bucket data as a source to populate a menu. Here are the steps:
In your job script, output data like this:
The
menu_itemsproperty name is arbitrary. Name it whatever you want. They key thing to remember is that it has to be inside adatawrapper object, alongside the"xy":1wire protocol flag, and it has to be a JSON array (square brackets).Next, run your job and confirm that you can see the output data formatted nicely in the job detail…