Digital Exchange Community

DX_Community_Banner.png
Expand all | Collapse all

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

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

    Posted 09-21-2019 12:01

    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.


  • 2.  RE: syntax for locating a file with today's date in blue prism

    Posted 09-22-2019 13:16
    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
    ------------------------------