Transformation Modal View in Pabbly Hook
Definition
The Transformation Modal View in Pabbly Hook allows users to view and manage the details of a specific transformation created within the system. This feature is accessible by selecting a transformation from the "Transformations" list on the left-hand side vertical navigation bar.Features and Fields Explained
1. Transformation Name
- Location: Top of the modal, prominently displayed.
- Purpose: Identifies the name of the selected transformation for quick reference.
- Editable: No, it reflects the name assigned during transformation creation.
2. Created At
- Location: Below the transformation name.
- Purpose: Indicates the exact timestamp when the transformation was initially created.
- Format: Follows the MMM DD, YYYY HH:MM:SS format for easy readability.
3. Transformation ID
- Location: Listed alongside other metadata.
- Purpose: Provides a unique identifier for the transformation. This is particularly useful for debugging or referencing the transformation in API calls.
- Editable: No, it is automatically generated by the system.
4. Last Updated At
- Location: Next to the "Created At" field.
- Purpose: Displays the most recent timestamp when the transformation was modified. Useful for tracking changes.
- Format: Same as the "Created At" field.
5. Transformation Code
- Location: In the main content section of the modal.
- Purpose: Shows the actual JavaScript code used for the transformation.
- Key Features:
- Syntax Highlighting: Ensures better readability of the code.
- Code Examples: Includes comments for common use cases, such as:
- Changing date formats.
- Renaming fields.
- Adding conditional fields based on specific logic.
Example Use Cases in Transformation Code
- Change Date Format:
if (request.payload.order_date) {
const [month, day, year] = request.payload.order_date.split('/');
request.payload.order_date = `${year}-${month}-${day}`;
}
- Rename Fields:
if (request.payload.orderID) {
request.payload.order_id = request.payload.orderID;
delete request.payload.orderID;
}
- Add Conditional Fields:
if (request.payload.total_amount && request.payload.total_amount > 1000) {
request.payload.high_value_order = true;
}
How to Use the Transformation Modal
- Viewing Transformation Details:
- Navigate to the "Transformations" section from the sidebar.
- Click on the desired transformation ID to open the modal view.
- Editing Transformation Code:
- Locate the "Transformation Code" section.
- Modify the code as needed. For example:
- Change the date format from MM/DD/YYYY to YYYY-MM-DD.
- Rename fields or add custom logic using JavaScript.
- Saving Changes:
- After making modifications, click the "Update" button (if available).
- Debugging:
- Use the Transformation ID to trace logs or identify issues in webhook integrations.
Additional Note on "Created At" Field
The "Created At" field in the transformation modal includes a timezone specification in the format:Transformation Created: November 29, 2024 16:09:39 (UTC +05:30) Asia/Kolkata
Explanation
- Purpose:
- The inclusion of the timezone ensures clarity about the specific time zone the timestamp refers to. This is particularly useful in scenarios involving global teams or when debugging logs and events that occur across multiple time zones.
- Components:
- Date and Time: November 29, 2024 16:09:39.
- UTC Offset: (UTC +05:30).
- Time Zone Region: Asia/Kolkata.
- Display:
- This detail is prominently displayed below the "Transformation Name," ensuring it is visible and easy to understand.
Usage Implications
- Debugging:
- When comparing timestamps in logs or events from other systems, ensure alignment with the specified timezone.
- Global Team Collaboration:
- Facilitates smooth communication by providing clarity about the timezone when a transformation was created.
- Compliance and Auditing:
- Useful for timestamp validation in regions where precise logging and timezone tracking are required for compliance.
Best Practices
- Validate Code: Before saving, ensure your JavaScript code is error-free to avoid runtime issues.
- Test Changes: Test the transformation using sample payloads to confirm it behaves as expected.
This documentation provides a comprehensive understanding of the transformation modal view in Pabbly Hook, ensuring users can efficiently manage and customize their transformations.
Attachments
-
1733740842295.png95.7 KB · Views: 10
-
1733741045457.png67.9 KB · Views: 9
-
1733741266130.png97.4 KB · Views: 9
-
1733741560850.png90.3 KB · Views: 11
-
1733741650651.png92.3 KB · Views: 9
-
1733741722555.png88.5 KB · Views: 9
-
1733741794918.png91.4 KB · Views: 10
-
1733741941656.png112.3 KB · Views: 8
-
1733742907447.png97.4 KB · Views: 4
-
1733744700326.png102.5 KB · Views: 4
Last edited: