Unable to add timestamp while saving the file

unable to add a timestamp, when I add it says the incorrect path.
@KarthikByggari

1 Like

How are you trying to do @balkishan?

2 Likes

I gave the path in a argument.
then create another variable which has timestamp like dd/MM/yyyy and assigned to timestamp
in the Attachment path folder, I gave like this in_Path+ " " +timestamp
If I give only in_Path then it save the file, but when I added the timestamp variable it’s showing me the incorrect path.
image
@HareeshMR

You are trying to create a path with the timestamp right?

And after the in_Path, try giving “/” before the timestamp instead of space and try @balkishan

2 Likes

@balkishan in_Path+ " " +now.time.tostring have a try like this buddy

2 Likes

image
not worked

Hi @balkishan

One more addition to @HareeshMR’s solution.

I’m just concerned about the timestamp format you are using here. Make sure the timestamp is not having any special characters like “:” in the time stamp format. This will run into errors because those are not considered as valid characters in path’s.

If you have such characters, just do a replace to something like “_” or something that you feels good to have. What I usually follow is the below format
YYYY-MM-DD HHMMSS

Hope it works for you!

5 Likes

image

1 Like

yes bro @balkishan,

When the timestamp is with “/” , then it won’t accept the path… So try changing the format.

Thaks @Lahiru.Fernando :slight_smile:

2 Likes

I given like this.
in_Path+ " " +now.ToString(“dd/MM/yyyy hh:mm:ss tt”)

1 Like

no, give it as now.tostring(“dd-mm-yyyy hh:mm:ss tt”)

“/” wont accept in the path as it will treat the path after “/” as subfolder in it

3 Likes

Yep. in your format the “/” and the “:” will not support in normal file path’s. So best way is to replace them with some thing like “_” or to the format that i mentioned in my previous post :slight_smile:

2 Likes

when I set as you mentioned in the post, it renamed the directory not the file name.
image

@Lahiru.Fernando

1 Like

usually file path wont take space inbetween buddy
Thats why we were getting such error like “The given path’s format is not supported”

So
we need to mention like this
in_Path+“\”+now.ToString(“dd_MM_yy_hh_mm_tt”)

Cheers @balkishan

2 Likes

I’m not getting you @balkishan

2 Likes

me neither :slight_smile: Couldn’t understand it bro

1 Like

Bro it renamed the folder name not the file name.
@HareeshMR

1 Like

Fine in order to rename the file name
Kindly follow the below steps that could help
because we cannot directly change the file name in save attachment actiivty as it takes only the folder path and not file name

Cheers @balkishan

1 Like

It’s creating folder bro not renaming the file.

1 Like

You are trying to rename the file with the time-stamp?

Try this along with the extension @balkishan… not sure if it works

image

2 Likes