Select to view content in your preferred language

embed object ID into photos as a watermark

994
10
12-26-2023 01:34 PM
EuropaxEarth
New Contributor III

As the subject title suggests I'm attempting to embed the "objectID" into each photo as a watermark so that when that photo is downloaded as a report, the ObjectID will be visible.

I've been referencing the following document for help: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-photo-watermarks/b...

I think I could create a new field, text type question for ObjectID. But since ObjectID is an Auto-increment field, I assume there's another approach I've failed to consider. 

 

Many thanks,

EuropaxEarth

0 Kudos
10 Replies
jcarlson
MVP Esteemed Contributor

When creating new features, the ObjectID doesn't even exist until the form is submitted. This might work for editing existing features, but the ObjectID usually isn't exposed in the form anyway.

What you might be able to do is include a hidden UUID field in your form, and use the formula uuid() to fill it in. Then call that same field in the watermark. This will uniquely identify the record to which the photo belongs, but in a way that will work with the watermarking options.

- Josh Carlson
Kendall County GIS
0 Kudos
EuropaxEarth
New Contributor III

Good point about the ObjectID's not existing until the survey's been published. Thank you!

After creating a UUID text field, I see the UUID value in the Survey123 Connect is very "lengthy" (for lack of a better word).

EuropaxEarth_0-1703635885929.png

 

I originally wanted to use "Object ID" because it assigns integers ( 1,2, etc) for each image. So if 10 photos were submitted I'd like the watermark to read photo 1 - photo 10  for each of the 10 photos. Thus, UUID may not be the value I'm looking for. 

I think I'd need to create a watermark code that assigns unique integer values for each photo. 

 

 

0 Kudos
abureaux
MVP Regular Contributor

I feel like there may be a disconnect between what you are asking for and the desired outcome here. What you hope to happen may be possible, but more details would be needed. 

What, precisely, is the desired outcome here? E.g., Can the user take more than one photo per submission? Do you just want the photos numbered 1 - x in the feature report? 

if you simply want the photos assigned a number within the survey, you could add a counter into a repeat along side the  photos that counts up (thus numbering your photos 1 - x within any given survey, which  you could then add that as a watermark to the photos). 

0 Kudos
EuropaxEarth
New Contributor III

Yes, let me clarify.

In this survey, users can take up to 50 photos per submission. These photos are geo-located. When viewing the submission results in Map Viewer I'd like for the coordinates and Photo ID to be watermarked in the photo. In the example below, the photo is the first of 10 that have been submitted. I've already watermarked the coordinate points in the bottom right hand corner. Since the photo below is the first photo, I would like "Photo 1" to be watermarked in the bottom left hand corner. Same thing for the remaining 9 photos (Photo 2, Photo 3, etc.)

EuropaxEarth_2-1703689811053.png

 

Ultimately, I would like a unique identifier embedded into each photo

0 Kudos
jcarlson
MVP Esteemed Contributor

I see, you want the integer to be based on the number of photos, not the form's objectid?

That sort of thing is possible with repeats, but I don't think I've seen it for photos. Here's a rather inelegant and tedious way to do it:

Create 50 image questions in your form spreadsheet. Hard-code the watermark in each to simply say "Photo 1" for the first, "Photo 2" for the second, and so on. That would make a gigantic form, though, so we need a way of hiding the photo questions unless they're needed.

Below the 50 image questions, add an integer question, let's call it "photo_count", for "how many photos do you want to attach?" and set its style to spinner. Have it default to 1. Then in the 50 image questions, give it a conditional visibility of ${photo_count} >= n where "n" is the photo number.

In that way, you'll start the form only seeing a single photo question, and below that, a spinner with a 1 in it. Clicking the "+" on the spinner will increment the photo_count, and then the next photo question will become visible just above the spinner.

- Josh Carlson
Kendall County GIS
EuropaxEarth
New Contributor III

I've created one image question that has the constraint set to 50. Similar to what you said, this allows the form to only show a single photo question - giving users the option to increase/decrease the amount of photos they wish to take by clicking the "+" or + "-".

Ideally, - and I'm still working on this - I could write a quick watermark script "Photo: x" where x equals the order position of that photo ( i.e. the 5th photo in a particular submission will be watermarked "photo:5") WITHOUT having to manually type in 50 image questions. However, I'd have to find a way for this watermark question to be a loop which so far, can only be done if I type in 50 image questions and have the watermark read photo: 1, Photo 2: … Photo: 50.

Basically, I'm trying to see if I can assign the integers based on the number of photos without having to manually create 50 image questions. 

 

 I've attached the XLS form if that helps.

0 Kudos
abureaux
MVP Regular Contributor

I'd just use position(..)

Drop that in your repeat. Each photo would then have a number associated with it, based on its position in the repeat. Use that calculate in your photo watermark.

abureaux_0-1703711939901.png

abureaux_1-1703711994813.png

 

0 Kudos
jcarlson
MVP Esteemed Contributor

That would require the photos to be in a separate table, wouldn't it?

- Josh Carlson
Kendall County GIS
0 Kudos
abureaux
MVP Regular Contributor

All I did was add position(..) into the preexisting repeat alongside the image question. So, the structure hasn't changed.