Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Analytic App/Python Tool

knnwndlm
8 - Asteroid

Hi SME,

 

I have a workflow that's connected to a Python tool using Alteryx.read("#1").  When I converted the workflow into Analytical App, I couldn't get the same reading to work.  Is there a way that I can import everything like Alteryx.read("#1") in an Analytic App?  Or do I have to use Alteryx.read("#1").iloc[i] where i is in a loop?  I do have a problem figuring out what i is though since it's depended on user's input.

 

Thanks,

kwl

9 REPLIES 9
apathetichell
19 - Altair

Hey - there have been a slew of posts about this over the past few months - the short is - do not have an Analytic App modify code inside of a python tool directly. Have the analytic app modify a text input (or other tool) outside of the Python tool - and then bring it into the Python tool. I also have no idea what Alteryx.read("#1").iloc[i] would do. Alteryx.read("#1") is AFAIK a set command to bring in the entire datastream coming in at #1. I do not believe you can truncate this in your read call - you can however modify this outside of the Python tool. 

BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@knnwndlm My Python tool isn't happy in the workflow, as there's no incoming metadata to it, but the app works just fine:

BS_THE_ANALYST_0-1686590746772.png


If that is effecting things for you though, perhaps push a dummy record through like this & filter out afterwards

BS_THE_ANALYST_1-1686590932497.png

 

All the best,
BS

LinkedIN

Bulien
BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@knnwndlm set the mode to 'Production'. I saw this in another python related post for apps: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Python-error-in-chained-Analyt... 

BS_THE_ANALYST_2-1686591045276.png

 

 

All the best,
BS

LinkedIN

Bulien
apathetichell
19 - Altair

@BS_THE_ANALYST How long have you been using it - and how many times? I'd recommend running some UAT on this to see if it always updates the code as you'd expect.

BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

hey @apathetichell. I'll have a little dive into it now. I'd not normally attack the Python tool directly with interface tools. The action tool does seem to imply that we can mess with it though. I can't speak about the reliability in doing so! 

 

All the best,
BS

LinkedIN

Bulien
BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@apathetichell 

Checking it with Debug:

BS_THE_ANALYST_0-1686591852594.png


Value has been changed in the notebook:

BS_THE_ANALYST_1-1686591895230.png


Running Debug workflow:

BS_THE_ANALYST_2-1686591920614.png



Running as Analytic App:

BS_THE_ANALYST_3-1686591970918.png


Looks to be a success. 

Things to note. It was important to keep the Python Tool on 'Interactive' not 'Production'. Production seemed to not allow the value to update.

I'm off for today! Maybe that's of some use to you guys. New workflow attached for UAT 

 

All the best,
BS

LinkedIN

Bulien
BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@knnwndlm it's pretty fiddly. I think the suggestion @apathetichell is better suited here, I'm not an expert with the Python tool by any means. It's cool to see that you can mess with it though, and some level of success can be found. In terms of reliability, that's for you to decide: @knnwndlm 


All the best,
BS

 

All the best,
BS

LinkedIN

Bulien
apathetichell
19 - Altair

@BS_THE_ANALYST my experience is that it will work approximately 75% of the time. The python venv is mildly unstable so if yo have other stuff going on - it can mess up.

knnwndlm
8 - Asteroid

Thank you @BS_THE_ANALYST and @apathetichell !

 

It turns out that the issue was related to having a Container inside a Control Container.  Apparently, that's not allowed.  Also, you can't run in Debug Mode with the Control Container.

Labels
Top Solution Authors