Welcome to AfterShift Template AI!
Your intelligent companion for creating, editing, understanding, and generating custom report templates for the AfterShift Android app.
Use the navigation above to explore our features:
- Create Template: Build a new template from scratch.
- Edit Template: Load an existing JSON template and modify it.
- Chat with AI: Ask questions about templates, app features, or anything else.
- Understand Templates: Get detailed explanations of the template structure.
- Generate with AI: Describe your desired template, and let our AI generate the JSON for you!
Create New Template
Template Fields:
Edit Existing Template
Chat with AI
Understand AfterShift Templates
AfterShift uses a JSON-based template system to define the fields and layout of your reports. These templates are designed to be flexible, allowing you to create custom forms tailored to your specific needs.
Core Components:
1. `ReportTemplate` (Overall Structure)
This is the root object of your JSON template. It contains metadata about the template and a list of `TemplateField` objects.
templateId
(String, required): A unique identifier for your template. Must be lowercase alphanumeric with underscores only (e.g., "daily_shop_report").name
(String, required): The display name shown in the app (e.g., "Daily Shop Report").description
(String, optional): A brief explanation of the template's purpose. Omit this key if value is empty.fields
(Array of `TemplateField` objects, required): The core of your template, defining all input fields and section headers. The order matters for display.reportFormat
(String, required): Defines how the final report text is formatted for export (e.g., SMS). Use{field_internalId}
placeholders. Use\n
for newlines.previewFormat
(String, required): Defines a short preview text for the main screen of the app. Use{field_internalId}
placeholders.
2. `TemplateField` (Individual Elements)
Each item in the fields
array is a `TemplateField`. It can represent an input field, a section header, or a field within a section.
type
(Integer, required): Defines the nature of the field.0
: Regular input field (`TYPE_FIELD`).1
: Section header (`TYPE_HEADER`).2
: Field within a section (`TYPE_SECTION_FIELD`).
internalId
(String, required): A unique programmatic ID for this field/header across the *entire template*. Used in `reportFormat` and `previewFormat` placeholders, and for calculations. Must be lowercase alphanumeric with underscores only. E.g., "total_sales", "date_field".displayLabel
(String, required): The human-readable label shown in the app (e.g., "Total Sales").defaultValue
(String, optional): An initial value for new reports. Can be empty (`""`). Omit this key if value is empty.inputType
(String, required for `TYPE_FIELD` and `TYPE_SECTION_FIELD`): Controls keyboard and validation hint. MUST be one of:"text"
(Default): Standard text input."textMultiLine"
: Text input allowing multiple lines."number"
: Numeric input (integers only)."numberDecimal"
: Numeric input with decimal points."numberSigned"
: Numeric input allowing positive/negative values and decimals."phone"
: Phone number input."date"
: Date input (currently uses text keyboard)."time"
: Time input (currently uses text keyboard)."password"
: Password input (characters are hidden)."email"
: Email address input.
editable
(Boolean, required for `TYPE_FIELD` and `TYPE_SECTION_FIELD`): Set to `true` if the user can type into this field, `false` otherwise (e.g., for calculated fields).isCustom
(Boolean, required): `true` if this field was added by the user, `false` for built-in fields. (Generally `true` for user-generated templates).parentSectionId
(String, required for `TYPE_SECTION_FIELD`): The `internalId` of the `TYPE_HEADER` this field belongs to. This header MUST appear *before* the section field in the `fields` array.calculationFormula
(String, optional for `TYPE_FIELD` and `TYPE_SECTION_FIELD`): A formula for calculated fields. If present, `editable` MUST be `false`. Omit this key if value is empty.- Formula format: Uses `internalId` of other fields as placeholders, e.g.,
"{field1} + {field2} * {field3}"
. - Supported operations: `+`, `-`, `*`, `/`.
- **Important Limitations:** Calculations are basic, strictly left-to-right, and multiplication/division are done before addition/subtraction in a single pass. For example, "10 + 5 * 2" would be evaluated as (10+5)*2=30, not 10+(5*2)=20. Avoid complex nested parentheses. Outputs are formatted to two decimal places.
- Formula format: Uses `internalId` of other fields as placeholders, e.g.,
Example Template Structure:
A simple JSON example for a daily shift summary:
Generate Template with AI
Describe the report template you need, and our AI will generate the JSON structure for you!
About AfterShift Template AI
This website is designed to complement the AfterShift Android application, providing tools to create, manage, and understand the custom report templates used by the app.
The AfterShift app allows users to quickly fill out predefined forms (templates) for various daily reports, such as shop reports, and then export them as clean, formatted text (e.g., for SMS or email).
Features of the AfterShift Android App:
- Customizable Templates: Define your own report structures using JSON templates.
- Diverse Field Types: Support for various input types including text, numbers (decimal, signed), phone, date, time, and multi-line notes.
- Calculated Fields: Basic arithmetic calculations can be defined within templates (e.g., sum of fields).
- Report History: Save and manage multiple reports within the app.
- Preview & Export: Preview your formatted report and export it via SMS or other sharing options.
- Theme Support: Light, Dark, and System Default themes, managed via app preferences.
- Template Management: Import new templates, set default templates for new reports, and delete custom templates.
This web tool helps you craft those JSON templates with an AI assistant that understands the app's specific template format and limitations.
Developed by Brendmung. Find the Android project on GitHub.