Ask AI
Skip to main content

Map form data

Function: Map form data

This action helps you organize and transform information collected from a form into a structured format, making it easy to use in other parts of your application. Think of it as taking raw answers from a questionnaire and neatly arranging them into a predefined report template.

Input

  • Data-format: This is like a blueprint or a template that defines the structure of your final data. You specify which fields (like "Name," "Email," "Product ID") and their types (text, number, date) should be included in the output. This input is required.
  • Mapping body: These are the instructions that tell the system how to match the fields from your form to the fields defined in your chosen "Data-format." You'll specify which form input corresponds to which field in your data structure. This input is required.

Output

  • Result: This is the name of the variable where the newly structured data will be stored. The data will be an OBJECT that perfectly matches the "Data-format" you specified. By default, this variable will be named CREATED_DATA.

Execution Flow

Real-Life Examples

Example 1: Processing a Customer Contact Form

Imagine you have a contact form on your website, and you want to save the submitted information into a structured Customer record in your database.

  • Inputs:
    • Data-format: You define a Customer data-format with fields like FirstName, LastName, EmailAddress, and PhoneNumber.
    • Mapping body: You set up rules to map your form fields:
      • form_field_first_name maps to FirstName
      • form_field_last_name maps to LastName
      • form_field_email maps to EmailAddress
      • form_field_phone maps to PhoneNumber
  • Result: A new Customer object is created, containing the neatly organized contact details from the form, stored in a variable named CREATED_DATA. This object can then be used to create a new customer record.

Example 2: Standardizing Product Feedback

You've collected feedback on a product through a survey, and the survey fields are named inconsistently. You want to standardize this data before analyzing it.

  • Inputs:
    • Data-format: You define a ProductFeedback data-format with fields like ProductID, RatingScore, CommentText, and SubmissionDate.
    • Mapping body: You create mapping rules:
      • survey_item_id maps to ProductID
      • user_rating_value maps to RatingScore
      • feedback_comments maps to CommentText
      • date_submitted maps to SubmissionDate
  • Result: A ProductFeedback object is generated, containing the standardized feedback data. This object can now be easily added to a list of feedback entries or used for reporting.

Example 3: Updating User Profile Information

A user updates their profile through a form, and you need to ensure the new information correctly updates the existing UserProfile record.

  • Inputs:
    • Data-format: You use your existing UserProfile data-format, which includes fields like UserID, Username, Bio, and Location.
    • Mapping body: You define how the form fields correspond to the profile fields:
      • profile_id_input maps to UserID
      • new_username_field maps to Username
      • bio_textarea maps to Bio
      • location_dropdown maps to Location
  • Result: An updated UserProfile object is created, containing the user's latest information. This object can then be used to update the user's record in your database.