Skip to main content

Excel and Power Automate

How to use Power Automate for AML, KYC, and CTF screenings in Excel.

In this tutorial we show how our API Check product can be integrated with Microsoft Excel and Power Automate in order to perform AML, KYC and CTF screenings. We choose to use Power Automate in this tutorial as it enables end users to orchestrate automated process flows without coding experience.

info

The tutorial was written in April 2024 and with the then available technology and software versions.

First we create a master Excel sheet which stores the customer names and some additional information relevant for screening. This serves as a customer database and is not further modified after the initial set-up.

In our example use case we want to trigger the screening on a daily basis and store the results in a screening result Excel sheet. The master Excel sheet is used as a basis for regular compliance screenings and the following steps are executed each time in Power Automate:

  • Create a screening result Excel sheet for the current execution
  • Call the dilisense API Check for each customer name
  • Update the Excel sheet with the screening results
  • Store the detailed screening results in a file

And this is the high-level flow in Power Automate:

Power automate scope 1

Prerequisites

Excel setup for Power Automate integration

The foundation of our tutorial is an Excel file named Customers.xlsx, stored on OneDrive. This file is crucial for our workflow, and it's structured with several key columns:

  • Id: Essential for accurately updating rows based on the API's response.
  • Name: Required to perform the screening.
  • Gender: Used to filter results and reduce false positives.
  • Fuziness: Helps in fetching results for names that are similarly spelled, enhancing the accuracy of your search (see fuzzy_search parameter).
  • Additional parameters can be configured (refer to request parameters); however, for simplicity, we will focus on these essential fields in this tutorial.
tip

The table needs to be formatted as table, as otherwise you can not refer to it from Power Automate.

  1. Select your data range.
  2. Navigate to the "Home" tab.
  3. Click "Format as Table", and choose your preferred style.

After populating the Customers.xlsx with sample data, here’s how it might appear:

Master Excel sheet

Any similarity to actual individuals, existing or past, is purely coincidental.

Setting up your Power Automate flow

Initiating a Power Automate flow is a straightforward process, crucial for automating tasks efficiently. Follow these steps to create a new flow optimized for customer screenings:

  1. Start from blank: Navigate to "Create" and select "Instant cloud flow." This option allows you to start building your flow from scratch.
  2. Naming your flow: Assign a descriptive name to your flow — "dilisense - Customer Screening Flow" — to easily identify its purpose.
  3. Trigger selection: Choose "Manual trigger a flow" for initial setup and testing. This trigger allows you to start the flow manually from Power Automate. Then click on "Create" to finalize the creation of your new flow.
Power automate new flow

While "Manual trigger a flow" is excellent for testing, consider using "Schedule cloud flow" for operational environments. This setting ensures that customer screenings are performed regularly and automatically, enhancing compliance and efficiency.

With the setup complete, we're ready to dive into constructing the targeted flow within Power Automate, detailing each step to ensure a robust implementation. Stay tuned as we walk through the process step-by-step, ensuring you can replicate and customize it according to your organizational needs.

Power automate end-to-end flow

1. Create new screening result sheet

When conducting Anti-Money Laundering (AML), Know Your Customer (KYC), and Counter-Terrorism Financing (CTF) screenings, it's crucial to organize and store results systematically for compliance and auditing purposes. Follow these steps to create a new Excel sheet specifically designed to capture and store each session's results. We use the information provided in the Customers.xlsx as a basis.

Power automate - Create new screening result sheet

Compose - Empty Excel file content

  • Goal: Define content of an empty Excel file.
  • Action "Compose" from "Data Operation"
  • Input:
{
"$content-type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"$content": "UEsDBBQAAAAIAAAAIQB2pmxuTgEAAAgEAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKyTzU4CMRSF9ya+Q9OtmSm4MMYwsPBnqSzwAWp7h2noX3oLwtt7p4ALg4iBzTTT9p7v9Nx2NFk7y1aQ0ATf8GE94Ay8Ctr4ecPfZy/VPWeYpdfSBg8N3wDyyfj6ajTbREBG1R4b3uUcH4RA1YGTWIcInlbakJzM9JvmIkq1kHMQt4PBnVDBZ/C5yr0GH4+eoJVLm9nzmqa3ThJY5Oxxu7FnNVzGaI2SmZyKldc/KNWOUFNl2YOdiXhDNrg4SOhXfgfs6t4ommQ0sKlM+VU6siHWVnyGtPgIYVEfFzngMrStUaCDWjpKoMaYQGrsALKzdRlrJ43f+z7Ep+JpChEpxgT/d7DPqa+uIglByga+kzpKpBacfWTom6xBn8jepV2iQVGG4YVj77tZhI+lTj4y3W7Yfs+3UMT+AGLeWMBLX7IiuieL8o7HXwAAAP//AwBQSwMEFAAAAAgAAAAhALVVMCP0AAAATAIAAAsAAABfcmVscy8ucmVsc6ySTU/DMAyG70j8h8j31d2QEEJLd0FIu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AAFsRAAB4bC93b3JrYm9vay54bWxQSwECCgAUAAAACAAAACEA6eHjsNABAACNAwAAGAAAAAAAAAAAAAAAAAD+EwAAeGwvd29ya3NoZWV0cy9zaGVldDEueG1sUEsFBgAAAAAJAAkAPgIAAAQWAAAAAA=="
}
note

It is not possible to add this content directly into the "Create file" action. Therefore the preceding "Compose" action is required.

Create file - Empty Excel file

  • Goal: Create file in which the customer names and screening results are later populated.
  • Action: "Create file" from "OneDrive for Business".
  • Folder Path: /dilisense/Screenings/@{formatDateTime(utcNow(),'yyyy-MM-dd')}
  • File Name: Customer Screening Result.xlsx
  • File Content: @{outputs('Compose_-_Empty_Excel_file_content')}

Create table - Screening result table

  • Goal: We want to add a blank table to the just created Excel sheet.
  • Action: "Create table" from "Excel Online (Business)"
  • Location: OneDrive
  • Document Library: OneDrive
  • File: @{outputs('Create_file_-_Empty_Excel_file')?['body/Path']}
  • Table range: A1
  • Table name: screening_result_table
  • Columns Names: Id,Name,Gender,Fuzziness,Hits,Timestamp

The Id, Name, Gender and Fuzziness are filled from the Customers Excel file. The Hits and Timestamp will be filled dynamically from the dilisense API Check.

List rows - From customer table

  • Goal: Before we can add the information from Customers.xlsx to the create table, we need to iterate through it.
  • Action: "List rows present in a table" from "Excel Online (Business)"
  • Location: OneDrive for Business
  • Document Library: OneDrive
  • File: /<your_parent_directory>/Customers.xlsx
  • Table: Table1

Apply to each - Add rows to screening result table

  • Goal: Iterate through each row.
  • Action: "Apply to each" from "Control"
  • Output from previous step: @{outputs('List_rows_-_From_Customers_Table')?['body/value']}

Add rows - To screening result table

  • Goal: Add each row from Customers.xlsx to the newly created table.
  • Action: "Add a row into a table" from "Excel Online (Business)"
  • Location: OneDrive for Business
  • Document Library: OneDrive
  • File: @{outputs('Create_file_-_Empty_Excel_file')?['body/Path']}
  • Table: screening_result_table
  • Row: @{items('Apply_to_each_-_Add_rows_to_screening_result_table')}

2. Conduct screening of names

Properly managing and storing data is crucial in any automated process, especially when handling sensitive information like customer screenings. Initializing variables at the start of your flow can enhance data management and provide flexibility for later uses. Follow these steps to set up a variable in Power Automate:

  • In your Power Automate flow, select "Add an action".
  • Choose "Initialize variable" from "Variable".
  • Name: Enter screening_result as the variable name to clearly identify its purpose.
  • Type: Select Array from the type options. This type is chosen to accommodate potentially multiple entries from each screening, providing a structured way to store and access the results.
  • Value: Leave the value field empty, as this variable will be populated dynamically with screening results during the flow execution.

The flow will look as shown below:

Power Automate - Conduct screening of names

List rows - From screening result table

  • Goal: Before we can screen for each name in Customers.xlsx, we need to iterate through it.
  • Action: "List rows present in a table" from "Excel Online (Business)"
  • Location: OneDrive for Business
  • Document Library: OneDrive
  • File: @{outputs('Create_file_-_Empty_Excel_file')?['body/Path']}
  • Table: screening_result_table

Apply to each - Add rows to screening result table

  • Goal: Iterate through each row.
  • Action: "Apply to each" from "Control"
  • Output from previous step: @{outputs('List_rows_-_From_screening_result_table')?['body/value']}

Parse JSON - From screening result table row

  • Goal: Enable an easy use of the data from the Excel.
  • Action: "Parse JSON" from "Data Operation"
  • Content: @{items('Apply_to_each_-_Call_screening_API')}
  • Schema:
{
"type": "object",
"properties": {
"@@odata.etag": {
"type": "string"
},
"ItemInternalId": {
"type": "string"
},
"Id": {
"type": "string"
},
"Customer name": {
"type": "string"
},
"Gender": {
"type": "string"
},
"Fuzziness": {
"type": "string"
},
"Hits": {
"type": "string"
},
"Timestamp": {
"type": "string"
}
}
}
Power automate - Prepare table

Compose - RequestURL

  • Goal: Assemble the request URL needed to call the dilisense API for the API Check product.
  • Action "Compose" from "Data Operation"
  • Inputs:
 @{concat(
'https://api.dilisense.com/v1/checkIndividual?',
'names=', uriComponent(body('Parse_JSON_-_From_screening_result_table_row')?['Name']),
if(not(empty(body('Parse_JSON_-_From_screening_result_table_row')?['Gender'])),
concat('&gender=', uriComponent(body('Parse_JSON_-_From_screening_result_table_row')?['Gender'])),
''),
if(not(empty(body('Parse_JSON_-_From_screening_result_table_row')?['Fuzziness'])),
concat('&fuzzy_search=', uriComponent(body('Parse_JSON_-_From_screening_result_table_row')?['Fuzziness'])),
'')
)
}
note

You need to add this as Expression as otherwise it will be considered a string.

HTTP - Call API Check

  • URL: @{outputs('Compose_-_RequestUrl')}
  • Method: GET
  • Headers: x-api-key = <your_api_key>
  • Queries: Leave this empty
  • Body: Leave this empty
  • Cookie: Leave this empty
Power automate - Prepare table

Switch - Response from screening API

  • Goal: Handle API responses according to their status code.
  • Action: "Switch" from "Control"
  • On: @{outputs('HTTP_-_Call_API_Check')?['statusCode']}

Case - 200 Success

  • Goal: Handle API responses with status code 200.
  • Action: Case
  • Equals: 200

Append to array variable - Success

  • Goal: Store each successful response in the screening_result variable for later processing.
  • Action: "Append to array variable" from "Variable"
  • Name: screening_result
  • Value:
@{json(concat(
'{',
'"id": "', replace(string(body('Parse_JSON_-_From_screening_result_table_row')?['Id']), '"', '\"'), '",',
'"data": ', string(body('HTTP_-_Call_API_Check')),
'}'
)
)}

Case - 400 Failure and default

Logging errors, especially those related to API requests, helps in troubleshooting and improving the reliability of your automated processes. By keeping an accurate record of failures, you can:

  • Analyze trends or recurring issues.
  • Adjust your API usage strategy or address data-related issues.
  • Maintain compliance with data processing standards, particularly useful in scenarios involving sensitive data like customer screenings.

We won't go into further details of logging, but recommend that you consider at least the 400 and the default cases.

3. Update Excel sheet

After conducting customer screenings using Power Automate, it's essential to update your results sheet with the number of matches found for each customer name. This data is crucial for analyzing the effectiveness of your screening process and for maintaining accurate records.

Power automate - Update screening result sheet

Parse JSON - screeningResult for Excel sheet

  • Goal: Parse the variable screening_result to make it accessible for the Excel update.
  • Action: "Parse JSON" from "Data Operation"
  • Content: @{variables('screening_result')}
  • Schema:
{
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"timestamp": {
"type": "string"
},
"total_hits": {
"type": "integer"
},
"found_records": {
"type": "array",
"items": {
"type": "object",
"properties": {
"gender": {
"type": "string"
},
"date_of_birth": {
"type": "array",
"items": {
"type": "string"
}
},
"citizenship": {
"type": "array",
"items": {
"type": "string"
}
},
"description": {
"type": "array",
"items": {
"type": "string"
}
},
"source_type": {
"type": "string"
},
"occupations": {
"type": "array",
"items": {
"type": "string"
}
},
"given_names": {
"type": "array",
"items": {
"type": "string"
}
},
"list_date": {
"type": "string"
},
"entity_type": {
"type": "string"
},
"pep_type": {
"type": "string"
},
"name": {
"type": "string"
},
"source_id": {
"type": "string"
},
"address": {
"type": "array",
"items": {
"type": "string"
}
},
"functions": {
"type": "array",
"items": {
"type": "string"
}
},
"links": {
"type": "array",
"items": {
"type": "string"
}
},
"positions": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"source_type",
"entity_type",
"name"
]
}
}
}
}
},
"required": [
"id",
"data"
]
}
}

For each - Customer name

  • Goal: Iterate through each customer name.
  • Action: "Apply to each" from "Control"
  • Inputs: @{outputs('Parse_JSON_-_screeningResult_for_Excel_update')['body']}

Update a row - In screening result Excel sheet

  • Goal: Update the customer record with the number of matches and a timestamp
  • Action: "Update a row" from "Excel Online (Business)"
  • Location: OneDrive for Business
  • Document Library: OneDrive
  • File: @{outputs('Create_file_-_Empty_Excel_file')?['body/Path']}
  • Table: screening_result_table
  • Key Column: Id
  • Key Value: @{items('For_each_-_Customer_name')['id']}
  • Provide The Item Properties:
{
"Hits": @{items('For_each_-_Customer_name')?['data']?['total_hits']},
"Timestamp": @{items('For_each_-_Customer_name')?['data']?['timestamp']}
}

4. Store results in file

In addition to recording basic screening outcomes in your Customers.xlsx — such as whether there was a hit — it's essential to store the detailed responses from your screening API call. This practice is critical for subsequent reviews and analyses, enabling your team to accurately identify true positives, false positives, and to support the development of a whitelist.

Power automate - Prepare table

Parse JSON - screeningResult for file storage

  • Goal: Parse the variable screening_result to make it accessible for the Excel update.
  • Action: "Parse JSON" from "Data Operation"
  • Content: @{variables('screening_result')}
  • Schema: See Parse JSON action above
Power automate - Prepare table

Compose - File result content

  • Goal: Define content that will be stored in a file.
  • Action "Compose" from "Data Operation"
  • Inputs: @{string(variables('screening_result'))}

Create file - Results

  • Folder Path: /dilisense/Screenings/@{formatDateTime(utcNow(),'yyyy-MM-dd')}
  • File Name: Output.txt
  • File Content: @{outputs('Compose_-_File_result_content')}

Resources

FAQs

Is a Power Automate connector available?
There is no connector available yet. If you face issues with using our API through Power Automate get in touch with us at support@dilisense.com

Is free screening volume available for the integration?
Yes, we provide free screening volume for the integration. Contact us at sales@dilisense.com