How Can We Help?
Import formula from TEXT
This documentation provides guidance on how to import a formulas from a text file. Follow the instructions below to understand the input formats, requirements, and features.
Features
- Flexible Input Formats:
- Accepts both:
- Quantity Ingredient Name Percentage (e.g., 5.00 phenyl acetaldehyde 50%)
- Ingredient Name Percentage Quantity (e.g., phenyl acetaldehyde 50% 5.00)
- Handles ingredients with or without percentages.
- Accepts both:
- Smart Ingredient Matching:
- Automatically matches ingredient names with existing records in the database.
- Inserts ingredient IDs if found, otherwise defaults to 0.
- Dynamic Concentration Handling:
- If a percentage is provided (e.g., 50%), it’s saved in the concentration column, and solvent is set to DPG.
- If no percentage is provided, the default concentration is 100, and solvent is set to None.
- Title Case Formatting:
- Automatically formats ingredient names to start with uppercase letters (e.g., phenyl acetaldehyde becomes Phenyl Acetaldehyde).
- Error Handling:
- Provides feedback if required fields are missing or if the formula name already exists.
- Displays errors for invalid input formats or database-related issues.
Usage
Step 1: Prepare Your Formula
Create your formula data in one of the following formats:
- Format 1:
- Quantity Ingredient Name Percentage
- Example: 5.00 phenyl acetaldehyde 50% 25.00 neroli oil 60.00 linalool
- Format 2:
- Ingredient Name Percentage Quantity
- Example: phenyl acetaldehyde 50% 5 neroli oil 25 linalool 60
Step 2: Enter Formula Name
Provide a unique name for the formula in the Formula Name field. This name will identify your formula in the database.
Step 3: Paste Formula Data
Copy and paste your formula data into the Formula Data field. Ensure the input follows the supported formats mentioned above.
Step 4: Submit
Click the Import Formula button to submit your formula.
How It Works
- Validation:
- The tool checks if the
Formula Name
andFormula text
fields are filled. - It verifies whether the formula name already exists in the database.
- The tool checks if the
- Parsing Input:
- The tool parses each line of the formula data.
- Matches quantities, ingredient names, and percentages using a flexible algorithm.
- Ingredient Matching:
- Searches the ingredients table for a match to the ingredient name.
- If found, adds the corresponding ingredient data to the formula.
- If not found, defaults to ingredient name only
- Tagging:
- Automatically tags the formula with “Imported formula”
Examples
Input Example 1
Formula Name:
Citrus Blend
Formula Data:
5.00 phenyl acetaldehyde 50% 25.00 neroli oil 60.00 linalool
Error Messages
- “Formula name and data are required.”
- Ensure both fields are filled before submission.
- “Formula name already exists.”
- Use a unique formula name.
- “Failed to import formula data.”
- Check for invalid data formatting or database issues.
- “Failed to insert formula tag.”
- Contact support for assistance.
Tips for Effective Use
- Formatting: Use the supported input formats for best results.
- Review: Double-check your formula data before submission to minimize errors.
For further assistance, contact your administrator or technical support team.