Create A Flow To Delete Tutorial Data From The Sample CRM Database

On Schedule App Tutorial

Integration Flows can be used to integrate data from one datastore to another while simultaneously transforming that data using formulas, such as merging fields, adding a suffix, modifying a data type, truncating a field, or removing whitespace. In this lesson we need to delete unwanted data from a datastore. Create an Integration Flow to filter Sample CRM lead records and remove the tutorial data added from the Sample Marketing files in the previous lessons.

Objectives

Learn how to:

Add A Flow

  1. Select Apps from the Menu bar.
  2. On the Apps page, select Create/Import to start your new App.

    Create or Import button

    Apps Page — Create/Import App

  3. Select All app types>Create a Scheduled app.

    Create Schedule app

  4. You can change the name of the app using the top left corner option. Select your TIBCO Cloud™ Integration - Connect Agent from the Agent drop-down.

    Tip: The TIBCO Cloud™ Integration - Connect agent is named using the name of your computer. For example, if the name of your computer is Ferrari, then the name of your agent is Ferrari Agent. If you have more than one Agent installed, a number is appended to the name.

    App renaming

  5. Select New Flow>Integration Flow.

    Create New Integraation Flow Button

  6. You can rename the Flow using the top left corner option.

    Flow rename option

  7. In the Connection panel on the left, select the Add Connection link.

    Add Connection Screen

  8. In the Add a Connection dialog, select the CRMTest Connection created in the lesson titled Configure A Sample CRM Connection from the drop-down and select OK to add the Connection to the Flow or click Create a New Connection to create a new one.

    Add connection screen

  9. Under the CRMTest Connection on the left, select the Query Block and drag it on to the Flow workspace.
  10. Select the General link on the Properties tab on the right side of the workspace. The Query Block Properties dialog displays with the General tab selected.

    Query block general property tab

  11. In the Entity field, select CRM_Customer.

    Query block entity tab

  12. Select the Filter tab and select the Add Add button button.
  13. In the Field drop-down select Category.
  14. Make sure the Operator is set to equals.

  15. In the Value field type "Connect Tutorial", including the quotes.

    Query Block Filter Tab

    Edit Query Block - Filter Tab

    Note: Preview tab displays the first 25 records regardless of the filter.
  16. Select OK to save your changes to the Query Block properties.
  17. Drag the For Each Result Block onto the Flow and put it under the Query Block. Make sure the Blocks are attached. If the For Each Result Block is transparent, as shown in the image below, it is not attached to the Query Block and the Flow cannot execute.

    For Each Result Block Placement

  18. Under the CRMTest Connection, select a Delete Block and drop it inside the For Each Result Block. The Delete block has a red icon on the corner because it has not been configured.

    Delete block not configured

  19. Select the General link on the Properties tab to open the Block Properties dialog for the Delete Block.
  20. On the General tab, select CRM_Customer in the Entity drop-down.
    Note: The Batch Processing option is not applicable here as the source and target database are simple spreadsheets.
  21. Select the Matching Criteria tab. Matching Criteria is used to locate the specific record in the target data that matches the source record being processed. This ensures that the correct record in the target is updated or deleted.
  22. In the Field drop-down select Category. This is the Category field for the record in the target datastore.
  23. Make sure the Operator is set to equals.
  24. Select Value tab and Select the Formula icon Formula symbol Value field to open the Formula Editor.
  25. In the Formula field type "Connect Tutorial", including the quotation marks. The Matching Criteria is used to make sure that the source record matches the target record before any action is taken on the target record.

    Delete Block Matching Criteria

    Edit Delete Block - Matching Criteria

  26. Select OK to save the Delete block configuration.
  27. Select OK to save and close the Flow.

Debug A Flow

Use the Flow, Delete Data, created in the previous section, to learn about Debug. Debug goes through the Flow one Block at a time and displays the results of each step for a single record from the Query. If the Flow executes successfully, the record used for debug is modified in the target datastore.

  1. On the Apps page, open the Delete Tutorial App.
  2. In the Flows section, select the Delete Data Flow to open it.
  3. Select Debug Mode at the top of the workspace.
  4. Select Start to begin the Debug process. Debug goes through the Query Block, selects the first record that matches the criteria configured for Query, and displays the record information in the Inputs panel.

    Debug start

    Debug Inputs For Query Block

  5. Select Next to move through the next Block in the Flow. Debug stops after the For Each Result Block and displays the lookup results used to fulfill the requirements of the Delete Block.

    Debug result for query block

    Debug Results For Delete Block Matching Criteria

  6. Click the Next button to move through the Delete block in the flow. Debug stops after the Delete block. Select the Results tab to display the record that was deleted in the results panel. Only fields used in the Flow are displayed. Fields associated with the deleted record, but not used in the Flow, are not displayed.

    Debug resut for deleted records

    Debug Results — Deleted Record

  7. Select Stop to stop the Debug process.
  8. Select Exit Debug Mode to exit the Debug process.

    Exit debug mode

  9. Select OK to close and save the Flow.

  10. Select the Run button at the top of the Delete Tutorial app. Any remaining Tutorial Leads records stored in Sample CRM are deleted as the Flow executes.
  11. Select Execution History, to view the Execution History for your App. Each time you successfully ran Debug, you deleted one record. If you encountered errors during your Debug session, those errors display in the Execution History when you select the Info icon Info button.

    Execution history

    Delete Tutorial Leads App — Execution History Detail

Return to On Schedule App Tutorial Overview to select the next lesson.