Invoking a DateTime argument

Hi,

So when I start my robot I have to put in a date for something specific, this date has to be used later in the process, so I can put it in a word document and add 3 days for the specific days. But I don’t know exactly how I can invoke the argument, and send it with to the process. Anyone have an idea? :slight_smile:

@silkefu

Arguments:

  • StartDate (Type: DateTime)

Main Workflow:

  1. Use Get Argument activity to retrieve StartDate.
  2. Calculate newDate: newDate = StartDate.AddDays(3).
  3. Use Word Application Scope to open the Word document.
  4. Inside the scope, use Replace Text to replace a placeholder with newDate.
  5. Save and close the Word document.

What is the get argument activity?

@silkefu

Sorry, Take the StartDate variable or argument

Should there be anything in “Value” in the main? So it can get the field key from the form designer which is “inputDate”

@silkefu

I don’t understand what you are asking.,

You have to pass the date, For example if your startdate is Todays date parse it as

DatetimeVar=DateTime.Now

it will give the todays date

or

if you get the startdate input from other sources like excel then parse it as

StartDate=DateTime.ParseExact(currentRow(“DateColumn”).ToString,(“your excel date format”), System.Globalization.CultureInfo.InvariantCulture)

How I get the date is that I choose it myself in the Form Designer. Like on a calender.

@silkefu

Form designer has arguments that you can create and add a out argument and link it to field key of the date…then in process you can sue the argument to get the data then dateVar.AddDays(3) can give you date with 3 days added if you need to convert to string then use .ToString("MM/dd/yyyy") the format can be changed as needed

cheers

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