I want task scheduler to run a job every day, every one hour, but not run on specific days, at specific hours

Problem:

I want to schedule a job to run every day, every one hour, but not run on specific days, at specific hours via the task scheduler.

Solution:

We add a Recurring Trigger that will run every one hour, and then within our job, we enter the following actions to specify during which hours of which days we do not want our job to run.

Discussion:

In our example we have specified that we do not want our job to run during weekends from 09.00 till 17.00, so if the day of the week starts with an “S” (Saturday, Sunday), then it should then check what the current time is and according to the result it should either continue with the job’s flow or end the job successfully if the current time is appropriate for the job to run.

I want to get a random line of a list

Problem:

I want to get a random line of a list

Solution:

We need to read the list, and use the Count property of our List to define the number of the lines contained in our list, in order to generate a random number within the defined region.

Discussion:

We use the “Read Text from File” action to specify the list we want to parse data and get the random line from. It is important to specify that we want to store the content as a List. We then use the “Generate Random Number” action to populate any random number within a region starting from 0 till the total number of the lines on our list.

I want to make sure that the user input is always a number.

Problem:

I want to make sure that the user input is always a number

Solution:

We simply convert the User’s Input, into a number, and add an exception to the event that the provided text cannot be converted into a valid number.

Discussion:

Using the “Display Input Dialog” action, We simply ask the user to type in a value. That value we then convert it to a numeric value using the “Convert Text to Number” action. If the value cannot be converted, that means that the user’s input is not a number. In the “Convert Text to Number” action we add an exception handling to perform some other actions in the event this error occurs.

I want to define my job’s flow according to the user’s input

UI automation

Problem:

I want to define my job’s flow according to the user’s input

Solution:

A general pattern used to define the flow of a job according to the user’s input can be found in the following job.

Discussion:

We use a “Display Input Dialog” action to retrieve some information from the user. In our example, it is obvious that there’s only one answer to the question made to the user. So, we can determine the flow of our job according to the user’s input.

When an Input Dialog appears, the user has two options. Either press ok or Cancel.

Manipulate every item of a list

Sometimes, automation means you may want to repeat one or more actions, for every item contained in a list. Either you want to use every item of an Excel row, or every line of a text file, you will have to deal with lists. In order to use every item of a specific list for a predefined set of actions, you will have to use a “For Each” loop (”For Each” action under “Loops” category).

A “For Each” loop, iterates through every item of a list and stores the current item in a variable. This kind of loop is extremely useful when you do not know or you do not need to know the number of the iterations that will be needed, but you do want to iterate through every item of a list and use each one of them in an action (or a series of actions).…

Copyright 2017 - Softomotive Ltd