Image - Filename

Hi all

I have an image table containing guess what, images. We are all aware the filename is set by Google for each image, I need to be able to rename an image in a sequential format. I have the sequence working in the following format: 12345-1.jpg, 12345-2.jpg....-3.jpg and so forth. The [12345] is taken from a [JobID] and the sequence is worked out using a counter column: MAX(SELECT(Images[Counter], [JobID] = [_THISROW].[JobID])) + 1

However, I can not see a 'filename' property which could take a concatenation to combine everything. The questio is , is there a filename property or setting to allow me to rename the image?

Many Thanks

 

Solved Solved
0 11 440
1 ACCEPTED SOLUTION

It seems I had the answer all along close by.

I changed my ID column from UNIQUEID() to CONCATENATE([JobID] ,"-", [Counter]+1) which resides in the INITIAL VALUE setting, problem solved, my images are now created with [JobID] [Image1] [Timestamp] which I can now use the image in my VB6 project.

View solution in original post

11 REPLIES 11


@DaveWillett wrote:

However, I can not see a 'filename' property which could take a concatenation to combine everything. The questio is , is there a filename property or setting to allow me to rename the image?


Could you elaborate this part? What exactly you are looking for?

Hi @Suvrutt_Gurjar 

I used ChatGPT to help me with a couple of things, ie the expressions and these are the instructions: 

DaveWillett_1-1732618853808.png

However, I cannot see a 'filename' property or setting?

Hi @DaveWillett ,

Please post such questions in "Q&A" section.

I think ChatGPT has responded you in an incorrect manner.

There is no 'filename' property in the column setting.

AppSheet names the image names by default in the sequence as

table_Key.Image_coumn_name.timestamp.file_extension

You may want to take a look at the following tip to name the images the way you want.

More User Friendly Image names for images uploaded... - Google Cloud Community

 

 

 

 

Thanks Suvrutt, I thought it had misleaded me, it would have been a great remedy if the setting was available.

Kind Regards

Just a thought @Suvrutt_Gurjar . Renaming the images isn't that critical. The images are used as attachments in the 'Other Attachments' area and sent via email. Can I just change the expression which picks up the image so it adds a leading [JobID] such as:

Original Expression: INDEX([Images][Image1],1)

Expression with leading [JobID]: CONCATENATE([JobID], "-", TEXT(INDEX([Images][Image1], 1)), ".jpg")

Would that work?

 

I believe you will not be able to that.

Steve
Platinum 5
Platinum 5

It is not possible to choose the name of uploaded files. To change the name, you may be able to do so by adding the upload folder as a data source and updating the file's name there. Or you could create a script that does it and invoke the script with an automation.

It seems I had the answer all along close by.

I changed my ID column from UNIQUEID() to CONCATENATE([JobID] ,"-", [Counter]+1) which resides in the INITIAL VALUE setting, problem solved, my images are now created with [JobID] [Image1] [Timestamp] which I can now use the image in my VB6 project.

Hi @DaveWillett  

Nice to know that you got a solution.

However please note that just in case your app is multi user app and that multiple users can add records simultaneously,  there could be a possibility of duplicate key because the [Counter] column expression seems to be based on serial number generation system.


@DaveWillett wrote:

MAX(SELECT(Images[Counter], [JobID] = [_THISROW].[JobID])) + 1


 

 

 


 

Yes I see that, we are testing at the moment so an easy change could be:

CONCATENATE([JobID] ,"-", UNIQUEID())

For now it's good, so we'll see if we can break it.

Many Thanks @Suvrutt_Gurjar for the support

 


@DaveWillett wrote:

Yes I see that, we are testing at the moment so an easy change could be:

CONCATENATE([JobID] ,"-", UNIQUEID())


Great. You are welcome.

 

Top Labels in this Space