Data Mapping Screen

Overview

The Data Mapping Screen enables users to review, map, and manage facility and user data uploaded via Excel sheets during campaign setup. It provides an interactive table where users can update statuses, modify boundaries, and add, edit, or delete rows before final submission.

This screen is used as part of the Setup Campaign workflow and ensures uploaded data is accurate, complete, and aligned with system boundaries.

Features

  1. Change Status

    • Users can update the status of individual rows in the sheet directly from the mapping screen.

    • Status options are predefined and ensure consistent data integrity.

  2. Modify Boundaries

    • Users can update the boundary information for rows uploaded in the sheet.

    • Boundary updates are validated to align with the application's existing structure.

  3. Add New Rows

    • Users can add, edit, and delete rows in the data sheet, offering flexibility in organising and maintaining the mapping data.

The screen is designed to provide a seamless user experience for data modification and management, with a focus on ease of use and intuitive interaction.

Steps

Step 1: Access the Data Mapping Screen

Trigger: User uploads a Facility Mapping or User Mapping Excel file and clicks Next.

What happens:

  • The system reads the uploaded Excel file.

  • Data is parsed and displayed in a tabular format.

  • Each row represents a facility or user record linked to the campaign.

Step 2: Review Uploaded Data

Actions available:

  • View all uploaded rows in a structured table.

  • Identify rows that require updates or validation.

  • Track the current status of each row.

This step allows users to verify data before making any changes.

Step 3: Update Row Status

Purpose: Ensure data readiness and consistency.

Actions:

  • Users can change the status of individual rows directly from the table.

  • Status values are predefined and controlled.

  • Status updates are validated to maintain data integrity.

Step 4: Modify Boundary Information

Purpose: Align uploaded data with campaign boundaries.

Actions:

  1. Select a row and choose Change Boundary.

  2. A pop-up appears with:

    • Boundary level selection

    • Boundary options specific to the campaign

  3. User selects the appropriate boundary.

  4. The system validates the selected boundary against the existing hierarchy.

Data Source:

  • Boundary information is fetched using:

    • boundary-service/boundary-relationships/_search

    • Lowest-hierarchy boundary codes are used for mapping.

Step 5: Add, Edit, or Delete Rows

Purpose: Allow corrections and enhancements without re-uploading files.

Actions:

  • Add new rows directly in the mapping screen.

  • Edit existing row details.

  • Delete invalid or unnecessary rows.

This provides flexibility to refine data during setup.

Step 6: Save Updates and Upload Mapped Data

Trigger: User clicks Next after completing updates.

Actions:

  1. Updated table data is converted back into an Excel file.

  2. The file is validated.

  3. The updated file is uploaded to the backend using the file store ID.

  4. Backend processing begins for the updated data.

Step 7: Validate Uploaded Data

Purpose: Ensure data correctness before moving forward.

Actions:

  • The system validates the uploaded file.

  • Status of each row is checked.

  • The UI continuously polls to confirm whether the data status is Validated.

Outcome:

  • If validation is successful, the user can proceed.

  • If not, the user can revisit the mapping screen to fix issues.

Step 8: Continue Campaign Setup

Once validation is complete:

  • The user moves to the next step in the Setup Campaign flow.

  • Data mapping for users or facilities is considered complete.

Integration With Setup Campaign Workflow

The mapping screen is integrated into the setup campaign workflow via a configuration object defined in setupCampaign.js. This ensures the mapping screen renders dynamically as part of the campaign setup process for user and facility mapping.

Configuration Details

Key Highlights

  • Step Count: stepCount: "4" defines the mapping screen's position in the workflow.

  • Component Integration: The component key renders the DataUploadWrapper component.

  • Custom Props:

    • module: Specifies "HCM" for Human Capital Management.

    • type: Indicates whether the data pertains to userMapping or another module.

    • Other dynamic data (dataParams, sessionData, hierarchyData) ensures a seamless connection to form data.

Key Components & Files

Component / File
Purpose

DataUploadWrapper.js

Renders the mapping UI

UploadDataMappingWrapper.js

Handles data upload and updates

MDMS & API Integrations

MDMS

  • Schema: adminSchema

API Calls

  1. Boundary Data Fetch: API Endpoint: boundary-service/boundary-relationships/_search

    • Fetches all lowest-hierarchy boundary codes required for boundary mapping.

  2. Excel File Processing:

    • The useReadExcelData and useUpdateAndUploadExcel hooks manage reading, processing, updating, and re-uploading Excel data.

Key Hooks

1. useReadExcelData

This hook reads the uploaded Excel file, converts its data into an array, and stores it in the context state.

  1. useUpdateAndUploadExcel

This hook converts the updated data back into a new Excel sheet, validates it, and re-uploads it to the backend for further processing.

After uploading the file, we validate the file and check if the status is validated or not.

Once this is successful, keep on checking the status to see whether it is validated or not.

Once everything is in place, the user can step forward and complete the setup process.

Last updated

Was this helpful?