Synchra.24
menu_bookDocumentation
Practical guides for setup and development

Find guides for getting started, building workflows and adding your own tools to your company workspace.

folderEmbedded services

Introduction

The basic scenario for running your own service inside Synchra.24.

Machine translation

The microapplication in Synchra.24 helps to add an internal company scenario without a separate large product. This can be a work form, an approval screen, a service for contractors, a special department dashboard, or an internal tool for a specific role.

When does it make sense to make a microapplication

The approach is suitable if you need:

  • close a narrow process that is not covered by standard modules;
  • embed an internal form or magazine into a single work outline;
  • give employees a separate screen for a specific task;
  • add a script related to tasks, documents, applications, or MotionCode.

How the launch works

The process usually consists of four steps:

  1. Define the scenario: what exactly should a user do in a microapplication?
  2. Describe the roles and access rights: who sees the screen, who can edit the data, who is just watching.
  3. Prepare the interface and data: which fields, statuses, tables, and actions are needed.
  4. Embed the application into the Synchra workflow.24: menus, roles, connections to other services, and navigation.

What is important to think about in advance

1. User Scenario

Before developing, it is useful to briefly fix:

  • who opens the screen;
  • what should he do in one go;
  • which data should be shown immediately;
  • which result is considered successful.

If a scenario can be explained in one paragraph, it means it is easier to implement and maintain.

2. Access rights and Roles

It is better to link the microapplication to the roles immediately. Then:

  • employees only see the necessary sections;
  • managers get the right level of control;
  • The interface is not overloaded with unnecessary functions.

3. Communication with the main services

A microapplication is especially useful when it does not live separately, but is integrated into existing processes.:

  • creates or supplements tasks;
  • works with documents and attachments;
  • uses applications and approvals;
  • complements working time accounting and MotionCode scripts;
  • provides data for analytics and reporting.

The basic structure of the microapplication

In practice, it is convenient to start with a simple composition.:

  • list screen;
  • card screen;
  • form of creation or editing;
  • statuses;
  • filters;
  • access rights.

This is enough to quickly launch the first working script and not overload the project at the start.

Launching automation from the service

In an embedded web service, you can use a registered event instead of your own HTTP webhook. First, save the service and create an event in the tab Events then select it as an automation trigger. The service code calls synchra.emitEvent('report_ready', { report_id: '125' }, { requestKey }) after the desired user action; the method does not create events in the registry.

The names are separated by the prefix of the permanent service ID, and the data is separated by the company. Confirmation event_id means admission to the queue. The preview does not run real scripts; the mobile bridge does not support this method yet. The full example, access rights and restrictions are in the Embedded Services Guide.

How not to complicate the first release

For the first launch, it's better:

  • leave only one key scenario;
  • reduce the number of roles to the minimum required;
  • do not add complex integrations if they are not required.;
  • first, test the process on a small group of users.

This way, the team gets a working result faster, and improvements can be made based on live feedback.

What can be prepared for the start

If you want to get to the launch faster, assemble it in advance.:

  • the name of the script and its brief description;
  • list of users or roles;
  • list of required fields;
  • process statuses;
  • examples of cards, tables, or forms, if they already exist.

What's next

If you already have an idea for a microapplication, the next step is usually to describe the scenario and roles. After that, you can proceed to designing the interface and embedding it in Synchra.24.

Access from the side menu of the web version

In the settings, enable Allow in the web version. For the embedded service, save and publish the code. Only employees with access will see the item in the menu; license and authorization restrictions remain in place. Web access is disabled by default.

In the built-in editor, separate the implementations via synchra.getRuntime(): mobile — native phone actions, web — your browser implementation. Details, including the adapter for the service via an external link: Launching in the web version.

Dashboard Widget

An appointment is available in the service settings Dashboard Widget with a separate height adjustment bar. The mobile application uses a standard WebView with a bridge; the web version uses a Shadow DOM for the trusted code of the embedded service. To display on the web, be sure to enable Allow in the web version. Access rights and publication continue to be checked. Details and restrictions: Purpose of the service and widgets.

Card Widgets

The service can be designated as a widget for a task, incident, document, departure, visit, event log, report, management employee, or management screen. The same WebView/Shadow DOM, SDK, and separate heights for platforms are used. Method synchra.getWidgetContext() returns the type, ID, and data of the current record; subscription synchra.onWidgetContextChange() updates them without restarting. Widgets are placed at the end of the card before the comments. Available display locations and context usage: Card and management widgets.

Shared data with automations

The service can not only read getArtifact, but also update an already created name via the built-in setArtifact(name, value) or an event app.automation.artifact.set. The entire value is replaced, and the user's rights are retained. Automation connects it via artifacts and reads at any stage, including context.artifacts in transform. The Complete Guide.

Installation from a local template

The ready-made HTML/CSS/JavaScript service can be packaged together with service.json to ZIP and download via Services → New Service → From the ZIP template in the web administrator. A new unpublished service is being created; the token and employee access are not transferred. The export from the editor already contains the required configuration. The package format, examples, rights and restrictions are in list of embedded services. To publish, use the form extension store; the local ZIP creates an independent copy without connection with store updates.