Hexagon Geospatial
MENU

Smart M.App

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 34
Registered: ‎10-21-2016

Execute recipe from Javascript code

[ Edited ]

Hello everybody,

 

I am wondering if it is possible to run/execute a recipe from Javascript code. 

 

We are trying to upload a shapefile (consisting out of multiple files) via the recipe panel, but multiple files selection isn't supported. The only way it seems to work is by uploading the shapefile (multiple files) to the Chest via M.App Chest first, and then using the Shapefile-input field in the recipe panel and using 'select the file from content' (instead of the desired 'select from local drive', which does work but only for single files).

 

Since this seems to be a bug in the recipe, I was wondering if it is possible to run a recipe from code. In this case I could use Javascript and the Smart M.App API to upload the files and then run the recipe from code, so the user would not need to access M.App Chest to be able to use the M.App (for us developers this is no problem, but we want to provide our users/customers with a clear, simple and intuitive user experience). 

 

Any help would be much appreciated.  

 

Regards,

Vincent

Technical Evangelist
Posts: 1,060
Registered: ‎09-11-2015

Re: Execute recipe from Javascript code

Hi Vincent,

 

Surely there is a way, you can use the geoprocessing service API, check possibilities in the API console. The full documentation is unfortunately not prepared yet but you can create a dummy App with spatial recipe panel and watch what requests are being issued when user clicks on the Execute button.

 

You must also know the spatial recipe ID which you can either see in the developer console while working with the recipe in M.App Studio or find using the search API.

 

Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Contributor
Posts: 34
Registered: ‎10-21-2016

Re: Execute recipe from Javascript code

[ Edited ]

Hi Jan Smiley Happy Thanks for your reaction! 

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.