YES!
This is exactly what I'm looking to do. That said, I think I'm struggling with the function block. In short, my code is organized as follows...
INITIALIZATION SECTION (95 lines of code including whitespace & comments):
(* Declare variables. For example *)
sID="Site01"
bID="abc123"
(* Using bID, generate dataset of entire databin *)
bin=Databin[bID]
dataset=Dataset[bin]
(* Using sID, generate three different site-specific datasets A, B, A+B *)
CODE BODY (2 lines of code, a MANIPULATE line and INSERT line):
(* Using datasets generated in the INITIALIZATION SECTION, draw bar chart than can be manipulated by selecting A, B or A+B *)
(* Using datasets generated in the INITIALIZATION SECTION, draw table showing A, B and A+B data *)
I saw you use the function symbol (:=). Can I encapsulate ALL of my code (initialization & body) in one function and if so how do you do this (again, am new to the Wolfram language)? Your example showed what appeared to be a single expression behind the := symbol. If I can encapsulate all my code then it should be straightforward to generate the APIFunction.
Look forward to your feedback!