What are our options for naming images when a...

(Greg Huston) #1

What are our options for naming images when a user takes a picture with an app? I’m trying to move some inspection photos online, while also offering our offline/non-app users some flexibility with viewing images. I’m wondering in what way can I affect the image name that is saved. I’m perfectly fine with the uniqueid being in the image name, but I would love to be able to append a “pass” or “fail” onto the image name. For example…

X958LK5R.jpg - I would love if I could have the user click a button (pass/fail) and have that image name (when saved) become X958LK5R-fail.jpg. This would allow my offline/non-app users to easily filter out fail/pass images.

Is there any way I can affect this with appsheet?

(Aleksi Alkio) #2

Could it be possible to add that value to your uniqueid value so it would be in the key value already?

(Dinh Nguyen Nguyen) #3

@Greg_Huston Hi Greg, as Aleksi has pointed out, right now you can only customize image names indirectly through the row ID. However, I can see how being able to directly control how image names are created can be a very valuable feature, and a few other users have raised this issue before. So, please feel free to add it to our feature request app (see link below) to help us track and plan features to develop in the future.

https://www.appsheet.com/feature-requests

(Praveen Seshadri (AppSheet)) #4

We already stick the row key into the file name. So if you want the status column (pass/fail) to be part of the image name, you can do that by making a virtual column that combines the names and mark that as the key. There are also options to control the folder name for the file (look in the Image column properties).

(Greg Huston) #5

I’m feeling like it might have something to do with the fact that my pass/fail field is editable. And keys should be initial values. But my pass/fail field isn’t set in stone until the user fills it out. Please help!

(Praveen Seshadri (AppSheet)) #6

@Greg_Huston, will look into this today. It seems like we have focused on uniqueifying the name without looking at the “aesthetics” of getting it to read meaningfully.

(Praveen Seshadri (AppSheet)) #7

Hi Greg, I looked at the details of our code.

  1. We extract out the component columns of the key (this is in order to ensure that there are invalid characters added by the computed key expression.

  2. We order them in the order of the columns in the table (I think this may have been a mistake — we should have ordered them in the same order that they were in the computed column)

  3. We construct a file name from the column values, without any separators. The code actually has the ability to separate them with underscores, but this has been commented out – because making this change now will break existing customers who depend on the current behavior.

So both #2 and #3 should be improved, but doing so will break some existing customers. If we do this, therefore, we’ll have to add an option to preserve the old behavior for some customers. So in short, we made a couple of short-sighted design decisions on this that are now biting us. Can you live with the current behavior?

(Greg Huston) #8

It’s pretty challenging to construct any kind of meaningful file names for employees to work with when I can’t affect the order, separation or really much in the filename. Let me try some hacky workarounds on my end, and perhaps you can do the same on your end to see if there’s a way to make this useable.

(Greg Huston) #9

So I tried to create a couple columns with app formulas that basically take the job number, and add a dot afterwards. Then I create a key using these columns. But Appsheet erases my appformula saying I can’t use it with a key. It makes sense why - then keys could change. But it really prevents any meaningful workaround :frowning:

(Praveen Seshadri (AppSheet)) #10

I feel your pain on this. let me see what we can do at our end.

(Greg Huston) #11

Hi,

OK so I’m trying to use a computed key as suggested - I htink that’s what @Aleksi_Alkio and @praveen were suggesting. I have a virtual column, type = text, name = _ComputedKey, and here’s the AppFormula…

CONCATENATE([Job Number],".",[Condition],".",[Picture_ID])

So it seems that if I have a job with job number 25898 and the photo condition is fail, the file name should be something like…

25898.Fail.PICTURE_ID. - then picture and timestamp. However, when the actual image file name gets uploaded, here’s what it looks like…

“lJXRvbf425898Pass.Picture.062920.png”

So unfortunately it’s putting the Picture_ID (which is uniqueID) first, then it’s putting the job number, then it’s ignoring the “.” in the concat, then it’s putting the condition. So it’s kind of working, but it’s unfortunately following a different order than I asked for, and ignoring things like periods. I’m wondering if Appsheet has limitations on special characters in the keys or ordering of computed keys. Really want to make this work if you guys could point out what I’m missing it would be great!

(Greg Huston) #12

I figured out of somewhat hacky workaround. I want the following formula - job number.pass/fail.uniqueID. Since appsheet doesn’t let me rearrange the columns, or really do anything with appformulas, I’ve structured my spreadsheet as follows for those columns…

Job Number | Decimal 1 | Pass/Fail | Decimal 2 | PictureID

Columns decimal 1 & 2 are not editable, hidden, and have initial values of “.” - and then I create a computed key with those 5 columns.

It’s truly hacky, but it works and now I’m having pictures named

25989.Fail.A4G7lx8.Picture.Timestamp.jpg

Which is GREAT because I can work with that.

LMK if you find anything on your end.