Select to view content in your preferred language

passing parameter to generate diagrm through custom quries

1175
5
Jump to solution
02-22-2013 09:04 PM
AbdulMateen
Emerging Contributor
hi,

i designed template which needs two parameters so at template level i created two parameters,
let us say substationid,substation type.

how to send these values from url to generate new diagram.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RickAnderson
Frequent Contributor
Still not completely sure what you have configured here.  What does it look like in ArcMap when the user clicks the generate diagram button and points to this schematic dataset and diagram template?  Is the name field a dropdown list that has concatenated values of substationid - substationtype?  If so, that is exactly what you need to pass in the name parameter of the rest call on server.
[ATTACH=CONFIG]22260[/ATTACH] 
In the attached image, you can see that my name field is a dropdown list containing some sort of field data.  On the server side, if I wanted to create this diagram, I would need to pass in the value of 671 for the name parameter.  Also for custom query on server you need to make sure to pass in an empty initialobjects parameter in the buildercontext.  See the rest api help for generatediagram

View solution in original post

0 Kudos
5 Replies
RickAnderson
Frequent Contributor
In your feature class queries, just use the ? as a special character

Select * from SomeTable where MyField = ?

Once you type in that question mark, you will see a parameters section open up.  You will see any attributes available for that feature class as well as the diagram template it belongs to.

I put together a video series on the resource center and one of those videos is specific to custom query.  I think I remember adding in an example using parameters.
http://resources.arcgis.com/en/communities/schematics/01n600000012000000.htm
0 Kudos
AbdulMateen
Emerging Contributor
hi sir,

i m sorry,i will elaborate my question again, i know using "?" at schematic feature class level for attributes.

At diagram template level i have two attributes  substationid,substationtype and these attributes are used in all schematic feature classes using "?".

how to send values to these two attributes substationid,substationtype from javascript using schematic api to generate diagram.

thank you for your reply.
0 Kudos
RickAnderson
Frequent Contributor
Still not completely sure what you have configured here.  What does it look like in ArcMap when the user clicks the generate diagram button and points to this schematic dataset and diagram template?  Is the name field a dropdown list that has concatenated values of substationid - substationtype?  If so, that is exactly what you need to pass in the name parameter of the rest call on server.
[ATTACH=CONFIG]22260[/ATTACH] 
In the attached image, you can see that my name field is a dropdown list containing some sort of field data.  On the server side, if I wanted to create this diagram, I would need to pass in the value of 671 for the name parameter.  Also for custom query on server you need to make sure to pass in an empty initialobjects parameter in the buildercontext.  See the rest api help for generatediagram
0 Kudos
AbdulMateen
Emerging Contributor
great solved thanks.
0 Kudos
Yu_ChingYu
Emerging Contributor
Hi,

I am going to generate diagram from Schematics Services.
Generate Schematics from the Desktop works well.
[ATTACH=CONFIG]24121[/ATTACH]

However, I can't figured out how to pass parameters to REST API: generateDiagram.
Recording from reply, "C114-000002" should be set in the name parameter and set builderContext as {"initialObjects": []}.
Like this:
http://myip/arcgis/rest/services/Schematic/TestSCHE/MapServer/exts/SchematicsServer/templates/1/gene...

The response is: { "error": {  "code": 400,  "message": "Invalid or missing input parameters.",  "details": [     ] }}".

Any help?
Thank you!!
0 Kudos