Select to view content in your preferred language

GPMultiValue:GPFeatureRecordSetLayer Help

886
2
Jump to solution
05-27-2021 12:25 AM
dcarson1661
Occasional Contributor

Hello,

I'm attempting to submit a job to a gp service that takes multiple Feature Sets as a parameter aka GPMultiValue:GPFeatureRecordSetLayer on the gp service end.

I have confirmed my gp service is working correctly by submitting jobs via the rest endpoint and manually supplying the parameter.

I'm using array.push() to add my feature sets to an array and using this as the parameter value for the gp service in my app.  

For some reason the arcgis server shows my input as having no value when coming from my app. I can see the network traffic and the array looks good when submitted. In fact I have copied the text in the headers and submitted it manually and the gp service runs great. 

Does anyone have some insight as to what might be happening here?

Thank You!

-Dane

0 Kudos
1 Solution

Accepted Solutions
dcarson1661
Occasional Contributor

Thanks for the ideas!

I had tried JSON.stringify() before with no luck and had failed to mention it.

This did give me an idea for a workaround though. I changed my gp service to take in a single string and fed it the JSON.stringify() version of my array of feature sets. On the gp service end I converted the string back to JSON and then used JSON to Features conversion to then work with the data as feature classes again. It's a workaround, but fits my needs at the moment. 

 

 

View solution in original post

2 Replies
BenElan
Esri Contributor

Here are a couple things I would try while troubleshooting an issue like this:

1) Test the same request in a REST Client (like Postman). It may work directly on the endpoint but break when the request comes from an external source for some reason. Use the same headers, body, etc.

2) Try using JSON.stringify() on the array before sending the request.

0 Kudos
dcarson1661
Occasional Contributor

Thanks for the ideas!

I had tried JSON.stringify() before with no luck and had failed to mention it.

This did give me an idea for a workaround though. I changed my gp service to take in a single string and fed it the JSON.stringify() version of my array of feature sets. On the gp service end I converted the string back to JSON and then used JSON to Features conversion to then work with the data as feature classes again. It's a workaround, but fits my needs at the moment.