How to use delay variable value(coming from config) in delay activity

Hello ,

I have delay value in the config excel as (00:00:03) I need to use this value as delay in delay activity.

note- excel is showing this delay as 12:00:03 AM not as (00:00:03) which I have supplied

You would need to store the delay value as TEXT in an excel instead of DATE or GENERAL.

text like?I am giving the value like 00:00:03

  1. Format cell value to TEXT.
  2. While giving in delay activity - need to convert string to timespan as duration property will accept timespan(datatype) only.
    • timespan.Parse(yourStringVariable)

Thanks!

Instead of giving 00:00:03 try giving '00:00:03

Hi
hope this expression would help you resolve this
–use excel application scope and pass the file path as input
–inside the scope use READ RANGE activity and get the output with a variable of type datatable named dt
–now use a FOR EACH ROW loop and pass the above variable dt as input
–then inside the loop use DELAY activity with this expression which will convert that time you mentioned to timespan
TimeSpan.Parse(Split(row(“yourcolumnname”)," ")(1).ToString)

Cheers @Karan28

I did the same as you explained me in the previous post , but its not working bot is not reading this format from excel
as after writing 00:00:03 format in excel config the value become liuke this -12:00:03 AM

Fine
so would you like to get it from excel the value 12:00:03 AM and use that in DELAY
or
you would like to update the value 00:00:03 to excel
Cheers @Karan28

I need to use the format value activity here?

I want value from config as 00:00:03 and use this value as delay variable in delay activity

awesome
your config has 12:00:00 AM as its value right…?

Cheers @Karan28

yes!

1 Like

fantastic
then this step would help you resolve this
–previous post did have this mentioned buddy, thats why gave the expression alone
so for this case these steps would work

kindly try this and let know for any queries or clarification

here you go with a xaml
it worked as well @Karan28
today.zip (14.9 KB)

Cheers @Karan28

delay.xaml (6.0 KB) delay.xlsx (8.3 KB)

Check this thanks!

Hi,

I suppose perhaps you should write your value as just second (like 3) in Excel config, and set the following expression at Duration property in Delay activity, if possible.

TimeSpan.FromSeconds(CInt(Config("DelayKey"))

Regards,

2 Likes

thankyou, this worked

1 Like

this xaml file is not opening in my uipath studio version

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.