I have an argument inside orchestrator that is defined as “File.txt”. The bot is looking for emails with attachments named “File.txt”. The attached files are now going to be name FileMMDDYYY.txt. Can someone please help me add a wildcard to the file for the date?
@timothy.mullady Can you change the published code? I can suggest a solution but for that, you have to change the code a bit and add an assign activity is that okay for you?
Step 1 : Set the asset value as “Filex.txt” in orchestrator.
Step 2 : Use Get asset activity to obtain tha value fro. Orchestrator asset and keep a string variable to store the output of the activity (AssetValue)
Step 3 : Use an assign activity, LHS the variable in which you want to store the file name
RHS(Use the expression like below)
AssetValue.Replace(“x”,DateTime.now.tostring(“MMddyyy”))
You can overwrite the argument value with the assign activity by giving argument name Assign Activity To= “argument name” and Value = “File”+Now.ToString(MMddyyyy)+“.txt”
I’m sorry for the confusion but I’m not trying to store the file name in that format. Someone sends emails with attachments named File.txt to a email box. The robot then searches for the file and stores them in a local folder. I’m asking the sender to add a datestamp the the file name so each file is unique.
I want the search to be based on “File”*“.txt” The date portion of the string would be a wildcard
You can make use of Save Email Attachments activity , this activity has a property that allows you to filter based on name of the attached file. You can use same expression “File*.txt” in the field filter by name.
Attaching a sample image, instead of .xlsx try using the File.txt