Generate Geodatabase

743
12
01-06-2020 06:18 AM
jaykapalczynski
Frequent Contributor

I am using the template example in appstudio to test downloading a geodatabase.  Its working as it seems it should but I have a question that maybe someone can help answer

In the example it is setting up some Geodatabase Parameters.  One of these is the Bounding box that the user specifies and as such all features within this box are downloaded to the Geodatabase.

My question.  Can I add w where clause anywhere in there?

// create the generate geodatabase parameters
GenerateGeodatabaseParameters {
    id: generateParameters
    extent: generateExtent
    outSpatialReference: SpatialReference.createWebMercator()
    returnAttachments: false
}

I tried this but getting errors...

QueryParameters {
    id: params
    whereClause: "created_user = 'Law'"
}

// create the generate geodatabase parameters
GenerateGeodatabaseParameters {
    id: generateParameters
    extent: generateExtent
    outSpatialReference: SpatialReference.createWebMercator()
    returnAttachments: false
     
    QueryParameters: params
}
0 Kudos
12 Replies
jaykapalczynski
Frequent Contributor

So like this?  whats the "new" for ?

var startDate = new Date(2019-03-24);

or this

var startDate = new Date( ' 2019-03-24 ' );

0 Kudos
PaulHaakma
Regular Contributor

Suggest you have a read up on javascript dates if you need help creating them....

Date - JavaScript | MDN 

JavaScript Date Objects 

You don't have to use a date object, you can just use the date strings. I just find it easier and more consistent to work with date objects and convert them back to ISO strings.

0 Kudos
jaykapalczynski
Frequent Contributor

The big problem for me is trying to figure out how ESRI wants the format to look to search its date field.  The syntax that is.  As I stated above I can get the date format correct for the DefinitionExpression but the same format does NOT work for the GenerateLayerOption...

If I can figure out how ESRI wants the date to appear and can get that working I can reverse engineer the date field and variable from there....why does one syntax work for the DefinitionExpression and not work for the GenerateLayerOption?

0 Kudos