cancel
Showing results for 
Search instead for 
Did you mean: 

syntax for locating a file with today's date in blue prism

I want Blue Prism to email a file that is created with today's date. I am putting in a 'check if file exists' using the file management object. When I put in the file path, i am having trouble with the syntax that will look for the file with today's date.

I have tried today(), format(Now mm.dd.yyyy) etc. I appreciate any help you can provide.

--------------------------------------------------
Disclaimer: This content was auto-posted from Stackoverflow. The original Stackoverflow question is here Stackoverflow Post, posted by lucie.
Hi  I am a Digital Worker. Please check out my profile to learn more about what I do!
1 BEST ANSWER

Helpful Answers

GeoffHirst
Staff
Staff
Hi Lucie,

Thank you for using Blue Prism.

If I understand exactly what you want to do is effectively search in the filename for todays date. What you would need to do is construct a data item that has today's date in exactly the format that it appears in your filename. This will be dependent on your culture settings to get this correct. However, if you look in a decision stage, you have the function InStr. This will look at a string and provide a response if a substring is found within it.

An example of this is as follows.

Lets say we have a text data item called MyFilename that contain "My_Filename_20190922.txt"

We want to find the text "20190922"

So, using InStr(MyFIlename,"20190922") would return a value of 13 as this is where the text we want to find starts in our data item.

I hope this covers what you are trying to accomplish.

Please come back to the forum if you need anything further.

regards

------------------------------
Geoff Hirst
Partner Pre Sales
Blue Prism
------------------------------
Geoff Hirst Senior DX Engineer - Digital Exchange - EMEA SS&C Blue Prism

View answer in original post

1 REPLY 1

GeoffHirst
Staff
Staff
Hi Lucie,

Thank you for using Blue Prism.

If I understand exactly what you want to do is effectively search in the filename for todays date. What you would need to do is construct a data item that has today's date in exactly the format that it appears in your filename. This will be dependent on your culture settings to get this correct. However, if you look in a decision stage, you have the function InStr. This will look at a string and provide a response if a substring is found within it.

An example of this is as follows.

Lets say we have a text data item called MyFilename that contain "My_Filename_20190922.txt"

We want to find the text "20190922"

So, using InStr(MyFIlename,"20190922") would return a value of 13 as this is where the text we want to find starts in our data item.

I hope this covers what you are trying to accomplish.

Please come back to the forum if you need anything further.

regards

------------------------------
Geoff Hirst
Partner Pre Sales
Blue Prism
------------------------------
Geoff Hirst Senior DX Engineer - Digital Exchange - EMEA SS&C Blue Prism