If
If - it is the one of activity from Control group. If given conditions are met the activity launches a group of activities on the left path. Otherwise it allows of execution of activities in the right path.
Let's make a simple example of an If activity. First, click the pencil icon to assign appropriate conditions to the activity.
Set the condition as shown in the screenshot below.
Next, add activities to the left and right paths.
On the left path, which will execute if the condition is met, add the Edit item activity and configure its parameters accordingly.
On the right path, which will execute if the condition is not met, add the Add item activity and configure its parameters accordingly.
After deploying the workflow in the designer, return to the SharePoint list. We add a new item by entering the value Book in the Title column field. We trigger the action with the If activity. After running it, we can see that the conditions were met, the activity was executed correctly, and the left path was followed. The current list item was edited by assigning the value from the Now function to the Date and Time column.
Now we will add a new item by entering the value "dddd" in the Title column field. We trigger the action with the If activity. After running it, we can see that the conditions were not met, and the activity from the right path was executed. A new item was created in the list, and the value from the Calculate function was inserted into the Number column field.