Launching the Flow from Process Builder

Now we will create a process to launch the Flow we have just created:

  1. To create a process, navigate to Setup (Gear Icon) | Setup | PLATFORM TOOLS | Process Automation | Process Builder in Lighting Experience, click on the New button, and enter the following details:
    • Name: Enter the name of the Process. Enter Custom metadata type in Flow -PB in Name.
    • API Name: This will be auto-populated based on the name.
    • Description: Write some meaningful text so that other developers or administrators can easily understand why this process has been created.
    • This process starts when: Configure the process to start when a record is created or edited. In this case, select A record changes.
  2. Once you are done, click on the Save button; it will redirect you to the Process canvas that allows you to create the Process.
  3. After Define Process Properties, the next task is to select the object on which you want to create a process and define evaluation criteria. For this, click on the Add Object node. It will open an additional window on the right-hand side of the process canvas screen, where you have to enter the following details:
    • Object: Start typing and then select the FeedItem object.
    • Start the process: For Start the process, select only when a record is created. This means that Process will only fire at the time of record creation.
    • Recursion - Allow process to evaluate a record multiple times in a single transaction?: Select this checkbox only when you want Process to evaluate the same record up to five times in a single transaction. In this case, leave this box unchecked.

It will look like what is shown in the following screenshot:

  1. Once you are done, click on the Save button.
  2. After defining the evaluation criteria, the next step is to add the process criteria. Once the process criteria are true, only then will the process execute the associated actions. To define the process criteria, click on the Add Criteria node. It will open an additional window on the right-hand side of the process canvas screen, where you have to enter the following details:
    • Criteria Name: Enter a name for the criteria node. Enter Type equals to TextPost as the criteria name.
    • Criteria for Executing Actions: Select the type of criteria you want to define. You can select either Formula evaluates to true, Conditions are met (a filter to define the process criteria), or No criteria-just execute the actions. In this case, select Conditions are met. 
    • Set Conditions: This field lets you specify which combination of the filter conditions must be true for the process to execute the associated actions. In this case, set [FeedItem].Type to Text Post.
    • Conditions: In the conditions section, select All of the conditions are met (AND). This field lets you specify which combination of the filter conditions must be true for the process to execute the associated actions.

It will look like what is shown in the following screenshot:

  1. Once you are done, click on the Save button.
  2. Once you are done with the process criteria node, the next step is to add an immediate action to launch a Flow so that it will pass the Feeditem ID to the Flow whenever any text post gets created. For this, we will use Flows action available in Process. Click on Add Action available under IMMEDIATE ACTIONS; it will open an additional window on the right-hand side of the Process canvas window, where you have to enter the following details:
    • Action Type: Select the type of action; in this case, select Flows.
    • Action Name: Enter a name for this action. Enter Launch a Flow as the action name.
    • Flow: Select the Flow that you want to execute; in this case, select the Flow Custom metadata type in Flow.
    • Set Flow Variables: Use this to pass the value in your Flow variables. For the current use case, map the variable VarT_FeedItemId with [FeedItem].Id.

It will look like what is shown in the following screenshot:

To assign values to multiple variables, click on the Add Row link.

  1. Once you are done with the process creation, the final step is to activate it. To activate a process, click on the Activate button available on the button bar. 

Now, if someone made a post on Chatter and it contains a banned word, Flow will auto-create a case for it, as shown in the preceding screenshot. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.204.7