Tools
Flow Control
26 min
if condition engini’s if condition activity offers a functionality equivalent to that of the if statement used in software development it provides a way to selectively execute different blocks based on whether set of conditions is true or false note that if you add more than one condition then they will be linked with the and operator first choose "flow controls" then click on the “if condition” action follow the next steps to define the activity add conditions you can add one or more conditions click on “add conditions” button click on left the field to show the tooltip with all the options you can choose you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) select the condition you want click on the right field to show the tooltip with all the options you can choose you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) repeat steps a d for all the fields you want to populate if true if all conditions are met, the workflow will turn to execute the process within the if yes block click on “+” button to add a activity that will be carried out if all condition are met if false if one or more conditions isn’t met, the workflow will turn to execute the process within the if no block click on “next step” button to add a acticity that will be carried out if the one or more conditions are not met for each loop the “for each loop” activity automatically iterates through each element in the data list and executes a set of activity blocks for each element if one of the activities in the loop fails and is not handled (for example, using the configure run after option), the whole loop stops choose the flow controls software and click on the “for each loop” action data list click on the empty field next to the data list label and the tooltip will popup showing only previous activities than contains data lists from which you can choose choose a data list to iterate on replace me click on “replace me” button choose the software you want in which the activity will be performed make sure the “action” button is makred choose the type of action you want to use repeat steps to add all the actions you want to perform inside the loop done the workflow proceeds to this step after the loop has finished processing all items in the list for more information on the possible actions for each software, see the apps category switch an activity that provides a workflow a way to selectively execute different blocks which are called “cases” depending on the value of a particular expression a switch can be used as an alternative to a series of nested ‘if’ statements when there are multiple possible values that need to be checked on one variable / expression each case has a set of activities specifically defined in it choose the flow controls software and click on the “for each loop” action follow the next steps to learn how to define this activity on value – click on the empty field to define the variable / expression that his result will be used for the switch cases evaluation equals – you have fill at least one case click on the action (in the photo "case 3") and click on empty field to fill a value that the workflow will check if it is equal to the variable or the expression you entered in the “on value” field next step – click the “next step” button to add an action that will be executed in case the “case value” equals the value in this case default – the workflow only executes the default block if it hasn’t executed any of the case blocks you defined for it in the default block, you can define one or more actions to be performed if this block is executed add case – repeat steps 2 3 to add more than one case to the switch block click on the “add case” to add another case do while the do while is a type of activity that allows a set of activities to be executed repeatedly as long as all conditions are true you can set one or more conditions if you add more than one condition, then they will be linked with the and operator choose the flow controls software and click on the “do while” action follow the next steps to learn how to define this activity click on the “add conditions” button to add a condition while the loop meets the condition, it will run and execute the activities you defined to define a condition click on the left field and the tooltip will pop up showing the options you can choose you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) select the condition you want the record to meet from the conditions list click on the rightest field and the tooltip will pop up showing the options you can choose you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) repeat steps a c for all the fields you want to populate advanced options the purpose of these fields is to prevent an infinite loop click the “next step” button to add an action that will be performed as long as the conditions are met you can define more than one action, by clicking the “next step” after every action you will add new action if you want to stop adding actions inside the “do while” activity, click on the next step outside the activity block see the apps category to learn how activities are used in different apps sort & filter a process of organizing data in a particular order based on a specified criteria (sorting) and then extracting data based on specific conditions (filtering) multi sort is supported choose the "flo controls" software and click on the “sort & filter” action follow the next steps to learn how to define this activity data list click on the empty field and the tooltip will popup showing only previous activities than contains data lists from which you can choose top n you can set the number of rows you want to retrieve this parameter limits the result set to the specified number of records, with the default being 100 if you set top n = 1, a single record will be returned instead of an array if no record is found, the action will fail, allowing you to implement an if condition within the workflow this can be useful for processes where the existence of a record determines the next steps in the workflow offset if you want to skip a certain number of rows before retrieving data, you can set the offset value the default is 0, meaning no rows are skipped add filter click on the “add filters” button choose from the drop down the item you want to filter by select the condition you want the records to meet for the selected field click on the rightest field to show the tooltip with all the options you can choose you can populate the field in one of the following options static value – number / string when using strings, you need to surround them with single quotes (‘) property value from a previous activity (using the tooltip that opens when clicking on the field) expression – using functions and/or previous activity properties and/or static values (using the tooltip that opens when clicking on the field) repeat steps inside add filter for all the fields you want to populate add sorting click on the “add sorting” button choose from the drop down the field you want to sort by choose the sorting option descending or ascending you can define a multi sort by adding more than one field to the sort use the arrows on the right to define the sort order – which field will be used as the primary sort, secondary, etc output metadata the sort & filter activity output includes a metadata section that provides information about the outcome of the process the metadata values can be used or displayed in later activities within the workflow source data count displays the total number of records retrieved from the selected data source before any sorts and filters were applied this represents the original dataset size filtered data count displays the number of records remaining after applying the defined filters and sorting criteria this represents the subset of data that meets the specified conditions scope a scope activity is a way to organize or group activities together in a workflow there are two important uses for scope error handling when designing a workflow, the workflow can sometimes fail or fall by condition the scope can be used as a “try and catch” mechanism by placing actions in a scope, you can “catch” any errors that occur within this is because errors that occur on an action within the scope propagate “up”, causing the scope to fail as well for example, if we configure a “send an email” action to run if the scope fails, we now have a workflow that notifies you if anything within the scope fails organizing your workflow when making a complex flow, it won’t take long for the number of steps to get out of control instead of scrolling up and down to navigate your flow, you can put actions into a scope you can click on the title to collapse it and the scope and all the actions within will be condensed into a single step, hiding sections of the flow you’re not working on this helps tiding up your workflow’s workspace and lets you focus on the actions you’re actively editing choose the flow controls software and click on the “scope” action add the activities you want to add inside the scope block by clicking on the “replace me” button inside terminate workflow terminating a workflow refers to ending the execution of a workflow this action is intentional and can be used when you want to prematurely end a workflow due to a specific reason or when a workflow has completed its intended purpose when using this action, you have to set one of the statuses failure, fell by condition, success choose the flow controls software and click on the “terminate workflow” action delay delay allows you to stop the workflow for a specified time for example, by entering the value 1 to count of unit to delay and choosing minutes, the workflow will stop for a minute and then continue to the next activity choose the flow controls software and click on the “delay” action follow the next steps to learn how to define this activity unit choose from the drop down the time unit count of unit to delay click on the empty field and and write down the amount of time you would like to stop