BookmarkSubscribeRSS Feed

Custom Task Tuesday: Multiple-Task Workflow Example for Saving SAS Visual Analytics Report Images

Started ‎03-17-2020 by
Modified ‎04-08-2020 by
Views 3,650

medium.jpg

 

1571079347403.png

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 AuthorThis 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.”

 

Saving SAS Visual Analytics 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:

 

Step1gif.gif

 

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:Step2gif.gif

 

Reasons for Creating a Multiple-Task Workflow

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.

 

Bonus: New Markdown Text Object!

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.

 

Check out the Task Tuesday GitHub

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!

Take Me to GitHub!

Join the Conversation on Twitter

Twitter_bird_logo_2012.svg.pngUse the hashtag #CustomTaskTuesday and tweet @OliviaJWright with your Custom Task comments and questions!

 

Version history
Last update:
‎04-08-2020 09:39 AM
Updated by:

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags