This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Have you ever one day, thought that you want to visualize your Python Graph into Alteryx, but suddenly remember Alteryx.write() need your output in the shape of data frames? Have you ever wondered that it will be nice if we can output Python beautiful data graph into Alteryx as one of report output like using AlteryxGraph function at R tools?
Since Alteryx.write() only accepts pandas data frames, we can not send image data from Python Tool to another tools such as Browse tool to display the image data. But as we know that Python graph visualizations are needed as alternative data visualization to complement Alteryx native visualization.
Our technical team realizes this is an opportunity to gain integration between Alteryx and Python, so we decided to try the method of using base64 lib with Python and the Blob Convert Tool on Alteryx to send and display image data so that it can be further visualized using the browse tool on Alteryx or saved using the Render Tool. This method also use io library in Python so it didn't need to create physical image file so you didn't have to worry about duplicate files.
The script for plotting that we used for sample is pretty simple. Using Alteryx.read(), we read the the input data as dataframe and then we plot the data using matplotlib library. The plot figures are converted to base64 string by first changing the figure into object type using io library. The base64 strings are writed as output of the Python Tool.
In Blob Convert, select conversion mode as Convert To a Blob and select the field that contains base64 strings. After using the Image Tool for converting the blob field, the image are displayed in Browse tool as seen in the following image.
Here is we attached sample workflow to demonstrate the propose method. Thank you!
Thank you for sharing the same, However I tried to do the same in our environment and successfully written to an output anchor. I used the Blob convert tool and followed the options you described. But No luck. The browse tool said "Chart not available for this data type". Any suggestions.