Variable file name with geoprocessing service?

11-07-2011 05:34 AM
New Contributor
I currently have a model which attaches a datestamp to every file it creates so as to allow different users to run it at the same time on the web and produce different files. The variable is calculated in my model and is called date so all the files are named %date%something in the model. The output is named %date%final.shp

This isn't a problem when I run the model from the toolbox. However when I publish it as a geoprocessing service and try and run it I get an error that says

"ERROR Invalid return value: C:\Users\WinSSHD_VirtualUsers\Downloads\WebGIS project\Counties00_08_web\scratch\%date%final.shp

2011-11-05 21:30:37

webGIS/Shock_Models.GPServerSync "

I can see why it doesn't like the return value since the name isn't actually %date%final.shp. Is there a way to indicate that the name isn't constant so that I can run it as a service?
0 Kudos
2 Replies
Esri Regular Contributor
Hi Melissa,

I think I understand what you're doing.
Could I suggest another solution?

Server handles the problem of files colliding when many people are running the service. Each execution server handles is done in a unique directory, because of this the files you output from the GP processes will never be in conflict with each other.

You handle writing output to the scratchworkspace.
In the end output of your model, if you were to change the output to:

.... everything should be good.

The topic here explains:

Give a read, by using this method you wouldn't have to use the Calc -> date method.

Hope this helps.
0 Kudos
New Contributor
Thank you! This and the link seem to really explain not only the output problem, but an intermediate data problem I've been having with the model.
0 Kudos