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
OBJECTthat perfectly matches the "Data-format" you specified. By default, this variable will be namedCREATED_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
Customerdata-format with fields likeFirstName,LastName,EmailAddress, andPhoneNumber. - Mapping body: You set up rules to map your form fields:
form_field_first_namemaps toFirstNameform_field_last_namemaps toLastNameform_field_emailmaps toEmailAddressform_field_phonemaps toPhoneNumber
- Data-format: You define a
- Result: A new
Customerobject is created, containing the neatly organized contact details from the form, stored in a variable namedCREATED_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
ProductFeedbackdata-format with fields likeProductID,RatingScore,CommentText, andSubmissionDate. - Mapping body: You create mapping rules:
survey_item_idmaps toProductIDuser_rating_valuemaps toRatingScorefeedback_commentsmaps toCommentTextdate_submittedmaps toSubmissionDate
- Data-format: You define a
- Result: A
ProductFeedbackobject 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
UserProfiledata-format, which includes fields likeUserID,Username,Bio, andLocation. - Mapping body: You define how the form fields correspond to the profile fields:
profile_id_inputmaps toUserIDnew_username_fieldmaps toUsernamebio_textareamaps toBiolocation_dropdownmaps toLocation
- Data-format: You use your existing
- Result: An updated
UserProfileobject is created, containing the user's latest information. This object can then be used to update the user's record in your database.