Enter next day date non weekend

Hi guys,

i am looking to have the bot pick up the next working day date, i have used this code below
DateTime.Now.AddDays(+1).ToString(“MM/dd/yyyy”) to insert the next working day date and the formula works fine, however if the bot is to run on friday it shoud then pick up mondays date and not saturdays date.

I would greatly appreciated any ones help regarding this.

Hai @nick.v:wink:Saturday too called as
weekend only… Well what formula r u using fr picking weekend dates?

i am using a type into activity with the formula therefore the bot needs to recognise its not a working day and then type in Mondays date @Nandhuba

it shouldn’t pick weekend dates, my formula works as it is but will pick weekend dates if ran on friday

@nick.v… Did u understand my qn? U made something Saturday related in ur formula … Check it whether it has anything Saturday related…

sorry i dont understand @Nandhuba

@nick.v… Can u share ur formula

yeah sure its

DateTime.Now.AddDays(+1).ToString(“MM/dd/yyyy”)

@Nandhuba

@nick.v… Well I’ve caught something related to ur query…Let’s try with this thread…
Enter next day date
Let me know is this useful

1 Like

that wouldnt work as i am not using that individuals method, i have used a formula into a type into activity where as that user was telling me to use 2 assign activities then a type into.
I used my formula as it was easier is there adaptations to it that can be used? @Nandhuba

If you want to mention different range we can store them in a variable like

str_fromdate = “yyyy-mm-dd”
str_todate = “yyyy-mm-dd”

And use type into activity for each field and mention the input string like this
str_fromdate.ToString+”[k(enter)]”
str_todate.ToString+”[k(enter)]”
U can do this enable SNED WINDOW MESSAGE property and disable Simulate type property

1 Like

no the format is not the issue

the system that is used only accepts date format in mm/dd/yyyy format @Nandhuba

Yeah absolutely… What u have feed as format it can adaptable only… No issues there

@Nandhuba so it there adaptations i can make to my formula so that when it pick the next working day date it doesn’t choose saturday?

For start date first u check last date is sunday or not
So use if condition to check
Date.now.Adddays(-1).dateofweek=“Sunday”
in Then : Enddate= Date.now.Adddays(-2).tostring(“dd”)
else : Enddate= Date.now.Adddays(-1).tostring(“dd”)

Let’s try this… Let me know if it helps…

1 Like

i have entered what you have advised however i get an error

what do i need to change? @Nandhuba

Create separate variables all of the above before giving the condition

does sunday need to be given a variable? i’ve given variables an yet still have an error
@Nandhuba

@nick.v… Check Given Below… Activity for selecting past working day and current working day

1 Like