1

I am running a GP script tool where a required input is set up as a RecordSet for the user to type multiple string values that will be used by the tool for further analysis. However, when I publish my tool as GP service and consume it within Web AppBuilder 2.3, the input RecordSet becomes a JSON set of fields:

{"displayFieldName":"","fields":[{"name":"OBJECTID","type":"esriFieldTypeOID","alias":"OBJECTID"},{"name":"Name","type":"esriFieldTypeString","alias":"Name","length":50}],"features":[],"exceededTransferLimit":false}

What I would like, instead, is an input parameter where the user can interactively type multiple string values that will be passed to the task. How can I accomplish this? Should I not use RecordSet?

1

First question: are you trying to consume your GP Service with the out-of-the-box Geoprocessing widget in WAB? Or are you making your own custom widget in WAB?

If you are using the out-of-the box Geoprocessing widget, then I have found that you will need to reconfigure the parameters of your GP Service to take in multiple string parameters.

If you would like to have more control (ie. in the case that you want your customer to be able to input a variable amount of string parameters), then you will need to make your own custom widget. You can still use the single RecordSet parameter in this case, however will have to modify the UI with your own fields that you would like to use as input then in your javascript handle the inputs to package them into a RecordSet that will be sent to the GP Service for execution.

Good Luck!

edit: here is a link to Task parameter properties (REST) on the ArcGIS for Server Publishing Services documentation

this is the docs on the WAB Geoprocessing Widget Parameter Types

  • Thanks for your comments. To answer your question: yes, I was really hoping to at least start using the out-of-the-box GP widget in WAB and then later on build my own custom one. So, you are saying I should set up my GP tool parameter (before publishing) that currently is RecordSet to type "String" instead? String Multivalue? Or you are suggesting that it has to be a pre-fixed number of string parameters? In the latter case it will not work because the user is adding a variable number of points on the map and each string matches one point, i.e. N strings for N points on the map.. – Francesco Tonini Feb 21 '17 at 14:11
  • I feel the frustration, I was in a very similar situation recently. I spent some time going through the code for the out-of-thebox Geoprocessing widget and found it was quite cumbersome to customize the existing code to suit my purposes. I came to the conclusion that it is truly What-You-See-Is-What-You-Get (WYSIWYG). Creating a custom widget is also a bit involved for a novice JavaScript developer, especially when getting further down the rabbit hole of Widget-to-Widget communications. – Tyler Austin Feb 21 '17 at 14:20
  • Ultimately, I decided that it was too burdensome to make the WAB do what I wanted to do and I am now pursuing making my own custom map webapp. I have spent some time forking a lot of example repos on GitHub feel free to check out what I collected: GitHub: tyler-austin – Tyler Austin Feb 21 '17 at 14:20
  • Thanks for the tips! So, do you think I could still build my own custom GP widget to do what you suggested but within a WAB app or you are saying for what I am describing I would also need to consider throwing away WAB as a whole? They always tell you WAB Dev Edition can be used to customize your own widgets and still work within that framework...thoughts? – Francesco Tonini Feb 21 '17 at 14:26
  • Yes, of course you can make your own custom GP widget. I am just saying it is quite involved. I would check out the Custom Widget Sample Code. The reason, I decided to not go this route is that the 2D apps with WAB use v3 of the ERSI JS API which was built on web technologies dating back to IE6 in 2008. Only the 3D apps in WAB use v4 of the API. If you are just beginning your venture into web development, I wouldn't want to learn outdated techniques that will be obsolete once WAB migrates to v4. – Tyler Austin Feb 21 '17 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.