For the complete documentation index, see llms.txt. This page is also available as Markdown.

Case Import Wizard

spinner

Before you start

Learning focus points


Objective

Allow users to easily create Cases through a custom, no-code import wizard.

Cases are automatically linked to the correct Accounts using readable, user-friendly external IDs, eliminating the need for data loaders and technical expertise.


Solution

The solution leverages Avonni Flow components.

Service users get a streamlined Data import wizard allowing the to create multiple cases from a CSV file with a few clicks.

How It Works (User Perspective)

  1. A Service user opens the Case Import Wizard tab, launching the screen flow

  2. They are prompted to upload or drop their CSV file containing Cases

  3. On the next screen, they review their data for inconsistencies before going further

  4. The flow displays Cases ready to be created with their matched Accounts

  5. Upon confirming, records are automatically created and the user gets a confirmation screen

What we'll create

  • 2 custom fields on the Case and Account objects to hold the Account External Id

  • 1 Screen Flow to ensure users benefit from a guided workflow

  • The flow will use Avonni flow components to display content

    • CSV Parser : this is a key component use to load and parse data from a CSV, here cases

    • Data Tables : used to display data as the process advances ensure full user control

  • The flow will use a custom Avonni Invocable Action to handle lookup resolution via an External Id field (or any key of your choice)

    • SObject Collection Get Record : used to match cases with accounts using an external Id field


Set up

Prerequisites

  • Create 2 custom fields

    • Create a field on the Account object : ExternalId__c (External id)

    • Create a field on the Case object : Account_External_Id__c (Text)

Build the Screen Flow

spinner
1

Create a screen element with the CSV Parser component

  • Drag the CSV parser into the canvas

    • Key fields to match : Account_External_Id__c

    • Add other columns as required by your use case

2

Create a second screen element with a Data Table component

  • Set the Data source as the output variable of the CSV Parser

  • Configure columns as needed

3

Transform Data into Cases

  • Use a Transform element to map the output of the CSV Parser with a custom case record collection variable

    • Important : map all the used fields

4

Transform Account External Ids into Text

  • Use a second Transform element to map the Account_External_Id__c field from the records from the CSV parser's output to a text collection variable

5

Retrieve your Salesforce Accounts

  • Use a Get records to query all accounts whose Id is in the transformed text collection

6

Loop on Case records

  • Use the SObject Collection Get Record to match Cases with Accounts

    • Source collection : Accounts

    • Operation : FIND

    • Search field Api Name : ExternalId__c (Api name on the Account object)

    • Search value : current case's Account_External_Id__c ( {!Loop_Cases.Account_External_Id__c} )

  • Assign Account to current loop case record

  • Assign current case record to a new Case record collection variable

7

Display Cases in a Data Table

  • Create a screen with a Data Table to allow users to review the records ready to be created

    • Use the new Case record collection variable as a data source

    • Display other fields as needed

    • Make columns editable so that users can act on fields as required

8

Assign and create Case records

  • Use an assignment element to populate a record collection with the previous Data table's cases

    • Create a Case collection variable : vCasesToCreate

    • Assign the Data table's recordsSObjectWithoutKeyField output

  • Use a Create records to create all cases in the new Cases record variable

9

Add additional screens

  • Add other screens or standard Salesforce elements as your use case requires

10

Save and review

  • Add the screen flow to your selected lightning page and make it available to users.


Going further

file-csvCSV Parsertable-listData TableProgress IndicatorHeader

Last updated

Was this helpful?