Welcome back for another Custom Task Tuesday mini-series! For SAS Global Forum 2020 I have written a piper titled: SAS® Studio Custom Tasks: Tips and Tricks for the Adventurous Task Author. This paper focuses on advanced custom task topics that aren't normally covered introductory materials, such as optional task sections, multiple-task workflows, advanced velocity template language, and working with CAS tables.
I released blogs on custom task topics related to the material in the paper every Tuesday leading up to the release of the SGF proceedings.
For the third post in this mini-series we looked at a multi-step two-task combination: “Step 1 – Retrieve Report Images” and “Step 2 – Save Report Images.”
These tasks take advantage of the SAS Viya reportImages Service and use code written by Mike Drutar that can be found on his GitHub page. These tasks must be run in SAS Studio 5.2 Enterprise (or later) session within a SAS Viya 3.4 (or later) environment that contains the SAS® Visual Analytics report that is being called.
The Step 1 task enables you to enter a report URI for a SAS Visual Analytics report. It then retrieves images of each tab of the report and creates a table with information on each tab, as well as displays the report images in the results window.
Watch the GIF below to see how "Step 1" works:
The Step 2 task uses the table created in the first step to allow the user to choose a report tab and download the image file to their specified location.
Watch the GIF below to see how "Step 2" works:
Often, task authors would like to run a section of code and incorporate the results back into the task prompt. While that isn’t something that is possible to accomplish within a single task, a common strategy is to create a multiple task workflow or dependent tasks labeled “Step 1,” “Step 2,” and so on. These separate tasks must then be run consecutively by the user.
It is helpful to label tasks with the prefix “Step 1” and “Step 2” because tasks are listed in alphabetical order in their folders. This naming practice also helps emphasize to the user that running the second step will not work unless you have previously run the first step.
The Step 1 task uses the new markdowntext object, available in SAS Studio 5.2. Markdown is a plain-text language that allows users to format their text to make it look more attractive. With Markdown, users can add text with headings, indentations, images, links, and things like bolding and italics to their tasks. The “Sample Task” available in SAS Studio 5.2 shows an example of all of the possible options in the markdown object.
Download both of these tasks (Step 1 and Step 2) from the Task Tuesday GitHub. Head over to view the code and try them out for yourself!
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.