Launching the Flow from Process Builder

Now, we will create a process to launch the Flow that we 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 - Custom metadata type in Flow -PB.
    • 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 was 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 will allow you to create the process.
  1. After Define Process Properties, the next task is to select the object upon 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 will 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 the 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 the process to evaluate the same record up to five times in a single transaction. In this case, leave this box unchecked.

The preceding steps will look as follows:

  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, the process will 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 will 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 that 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.

The preceding steps will look as follows:

  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 the Flows action available in Process Builder. 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 will 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.

The preceding steps will look as follows:

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. Click on the Activate button, available on the button bar:

Now, if someone makes 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.147.56.45