A Freshworks Platform 3.0 React Meta sample app that demonstrates conditional ticket field visibility using Interface Methods, Data Methods, and dual-location synchronization between ticket background and ticket sidebar.
Refund workflows often need a streamlined ticket view — high priority, no internal notes clutter. Hide Fields automates that behavior in the background while the sidebar provides an interactive Properties widget playground for hide, show, enable, and disable, with per-ticket persistence.
- Automatic field rules (background) — when ticket type is Refund, set priority to High and hide Internal Notes; show notes for all other types.
- Properties widget controls (sidebar) — Show/Hide/Enable/Disable for
status,priority,ticket_type,group,product, andtagwith persisted button selection per ticket.
| Surface | Placement | Behavior |
|---|---|---|
app/ticket_background.html |
support_ticket.ticket_background |
Headless logic: hide/show note, set priority on Refund |
app/ticketSidebar.html |
support_ticket.ticket_sidebar |
React sidebar: Properties widget Show/Hide/Enable/Disable with persisted selection |
Background and sidebar call client.interface.trigger() with actions hide, show, enable, and disable:
await client.interface.trigger('hide', { id: 'note' });
await client.interface.trigger('show', { id: 'status' });
await client.interface.trigger('disable', { id: 'priority' });The sidebar persists each field’s last selected action per ticket in localStorage. On refresh, it re-applies saved actions silently and highlights the selected button.
Both locations read ticket type with client.data.get('ticket'). The sidebar writes type changes with setValue on ticket_type.
The background script listens to app.activated, ticket.updated, ticket.typeChanged, and ticket.propertiesLoaded. When the sidebar toggles type, the background applies field rules without polling.
| Component | Usage |
|---|---|
<fw-button> |
Show/Hide/Enable/Disable actions with primary color for the active selection |
<fw-spinner> |
Loading state before catalog renders |
├── app/
│ ├── ticketSidebar.html # Ticket sidebar shell (React Meta entry)
│ ├── ticket_background.html # Background entry (headless logic)
│ ├── scripts/
│ │ └── app.js # Background hide/show and priority rules
│ ├── components/
│ │ ├── bootstrap/
│ │ │ └── crayonsInit.js # Crayons loader + CSS
│ │ └── placeholders/
│ │ ├── PlaceholderWrapper.jsx
│ │ ├── ticketSidebar.jsx
│ │ └── TicketSidebarApp.jsx
│ └── styles/
│ ├── style.css
│ └── images/
│ └── icon.svg
├── config/
│ └── iparams.json
├── tests/
│ └── app.test.js
├── manifest.json
├── package.json
├── usecase.md
└── vitest.config.js
- Freshworks CLI (FDK) v10.1.2 or later
- Node.js v24.x
- A Freshdesk trial account with ticket types including Refund and Other
Enable global apps before local development:
fdk config set global_apps.enabled true- Clone the repository and enter the app directory:
git clone <repo-url> cd hide-fields
- Install dependencies and validate:
npm install fdk validate
- Run the app locally:
fdk run
- Open a Freshdesk ticket with
?dev=true:https://your-domain.freshdesk.com/a/tickets/1?dev=true - Test the workflow:
- Set ticket type to Refund in the native properties panel — Internal Notes should hide and priority should become High.
- In the sidebar, click Hide on a property field — the button stays highlighted and the choice persists when you refresh the ticket.
npm test- Background + sidebar — put enforcement logic in
ticket_backgroundso rules apply even when the sidebar is closed; use the sidebar for agent controls and method exploration. - React Meta for sidebars — React Meta apps can ship multiple UI surfaces while keeping Platform 3.0 initialization (
app.initialized()) and lifecycle events intact. - Interface method IDs — use documented element IDs (
note,status,priority, etc.); hide/show removes visibility while enable/disable controls editability.
