WebApp interfacing project variable and flow

Solved!
RomuCandice
Level 2
WebApp interfacing project variable and flow

Hi DataIku,

I want to create a user interface for a complexe recipe present in my flow. The goal is to drag and drop an image, choose input parameters, then run the recipe and observe the output. 

My idea was to interface through a dash webApp. I though using project variable as input parameter to the recepe, where the user is able to modify them though a the webApp interface. 

I then though to include the webApp in a Dashboard. When the parameters are ready, the user can launch a scenario, through the dashboard , that will run the recepe. The output would the nbe displayed on the dashboard in a managed folder view (output is a transformed image). 

But i got several problems. Is it possible to change project variable from a (dash) WebApp? I am trying to assign values to variable inside dash callback function:

Capture.PNG

But it does not seem to work. Would you know why ? Is it a permission issue ? Or a wrong way to acess variables.

I also attempt an image upload:

Capture2.PNG

Is it possible to access a flow's managed folder to copy the uploaded image, so that the recipe can access it ? I would think it is possible through the dataIku API ? Would you have a code example ? 

 

Many thanks,

Nathan


Operating system used: Windows

2 Solutions
RomuCandice
Level 2
Author

Sorry! 

About writing variables inside callback, I managed to solve it :

Simply add :

handler.set_variables(vars)

after assigning new variable values...

View solution in original post

RomuCandice
Level 2
Author

So I figured out everything:

When reading an image from a drag and drop (see: https://dash.plotly.com/dash-core-components/upload), simply access managed folders, and save image like this:

DI support.PNG

Here we save the first image selected in the drag and drop (list_of_contents[0]), but you can get the principle from here.

 

View solution in original post

2 Replies
RomuCandice
Level 2
Author

Sorry! 

About writing variables inside callback, I managed to solve it :

Simply add :

handler.set_variables(vars)

after assigning new variable values...

RomuCandice
Level 2
Author

So I figured out everything:

When reading an image from a drag and drop (see: https://dash.plotly.com/dash-core-components/upload), simply access managed folders, and save image like this:

DI support.PNG

Here we save the first image selected in the drag and drop (list_of_contents[0]), but you can get the principle from here.