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:
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:
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
Best Answers
-
Sorry!
About writing variables inside callback, I managed to solve it :
Simply add :
handler.set_variables(vars)
after assigning new variable values...
-
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:
Here we save the first image selected in the drag and drop (list_of_contents[0]), but you can get the principle from here.