developer-support icon indicating copy to clipboard operation
developer-support copied to clipboard

Customizing Downloaded Filename

Open someevil opened this issue 7 years ago • 2 comments

Hey,

I am wondering if it would be relatively simple for me to modify this code somehow to not use the ObjectID in the naming of the file, but instead use a column I have in my feature layers called ASSET_ID?

Basically can I reference this other column when the code re-names the photos?

Cheers

someevil avatar Aug 06 '18 02:08 someevil

I think what I am trying to do is not possible, as the Asset_ID is not kept in the same table as the attachment info... this is the info the object holds: {'id': 19, 'globalId': '73d1d45a-cf17-46fd-91e9-9ca1def7cb39', 'parentGlobalId': 'a151e9bc-7042-49d6-9d19-2a3e7fefd2af', 'name': 'Photo1.jpg', 'contentType': 'image/jpeg', 'size': 553514, 'keywords': ''}

I would have to do some fancy join back on the global ID, then find the asset_id, which I think is above my skill level!

someevil avatar Aug 06 '18 02:08 someevil

#Query to get list of object ids in layer featureObjectIds = featureLayer.query(where='1=1', return_ids_only=True)

Well, to give you some guidance, this is where you will need to start your quest. Note how "return_ids_only" is set to true. You should be able to get your feature's field data by changing that.

I know this isn't a full answer, but it should be a nudge in the right direction. I don't know everywhere that would need to be changed/added as I have only skimmed the code.

Good Luck!

dwaggenspack avatar Oct 29 '18 16:10 dwaggenspack