I am working currently on a robot who is downloading an excel file from SAP and saving it in a specific place.
The file should have this name: “Target hours_FY23_P05.xlsx”.
Now i want to create a dynamic variable for the “P05”. The logic is that the month October is P01, November P02, December P03 and so on.
The bot should check which date we actually have when downloading the file (for example: 14.02.2023 → February → P05) and then save it.
You can use switch case activity for all the months and if particular months comes we will be in that case and you can set the file name according to that particular month. Hope this helps you
first you can create a list of string, starting with the value of january (it should be P04), and assing each value in order until you reach the december value, your array should contain 12 values.
then based on the month number just retrieve that position minus 1 (because array starts from 0 and months from 1) from your array like this
yourList(CInt(Now.Month - 1))
then just pass this value to your dynamic path
the other way is like @Naman_Jain suggest above, just create switch case activity and pass each corresponding value