feed: a worked URL-parameter example for the hook read, and the generated cover

This commit is contained in:
blog-dev
2026-09-27 20:47:51 +00:00
parent 6469ad00a3
commit b61ec07c87
2 changed files with 11 additions and 1 deletions
+11 -1
View File
@@ -64,16 +64,26 @@ Those are the services that run customer code. The viewer's `viewlibs`, `viewtab
## Reading them in a hook
A hook script is `%include`d into the running service, so it shares the service's WORK library and can read the tables directly. A URL parameter by name:
A hook script is `%include`d into the running service, so it shares the service's WORK library and can read the tables directly. Take an embedded editor opened at:
```
https://datacontroller.io/#/editor/SASHELP.CLASS?labels=true&embed=va
```
`browser_url_vars` then holds a row per parameter - `labels=true` and `embed=va` - and a hook can read either by name:
```sas
%let labels=N;
%let embed=N;
%if %sysfunc(exist(work.browser_url_vars)) %then %do;
proc sql noprint;
select value into :labels
from work.browser_url_vars
where name = 'labels';
select value into :embed
from work.browser_url_vars
where name = 'embed';
quit;
%end;
```
Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 53 KiB