Skip to main content

Custom user tasks

For maximum efficiency when performing tasks in your stores with your Tasks App, EVA allows you to create your own custom user tasks templates and with those, custom user tasks.

Creating custom user tasks via API or Admin Suite

Currently the flows for creating the tasks are available via API only, while the corresponding front end is underway.

Steps

Ultimately, the only thing you need to do to get up and running with your custom user tasks is the creation of a custom user task template. This template is what allows you to create the actual task, which is kicked off in the corresponding App straight after its creation.

If you'd like to go through the entire process however, to get a grip on how to make the most of your custom user tasks, take a look at the following steps.

  1. Creating relevant custom fields
  2. Create a custom user task type
  3. Create a custom user task template
  4. Create a custom user task

Creating custom fields

By adding custom fields to your custom task, you can expand your customization options. To show off the kind of possibilities, we'll be creating two custom fields in our example.

We want our first custom user task to revolve around taking a picture, say of a customer being happy with their purchase. Our second task will involve specifying a barcode.

How to create a custom field is described in detail in our Custom fields docs, but these are the most relevant steps for our specific tasks:

  • Create a new custom field “CustomerPicture“ of type Blob with InputHint “PHOTO”
  • Create a new custom field “SpecialBarcode“ of type String with InputHint “SCANNER”
{
"TypeID": "8", // UserTask
"Name":"CustomUserTaskPhoto",
"DisplayName":"Customer picture",
"DataType": 8, // Blob
"BackendID": "custom_user_task_photo1",
"InputHint": "Photo"
}
Run GetCustomFieldTypes

Since the IDs listed in these examples don't necessarily match the ones in your environment, run GetCustomFieldTypes first to see which is which.

Creating custom user task type

Any custom user task type you create automatically becomes a subtype task of the Custom task type itself, as can be seen in GetUserTaskTypes.

Create a new custom user task type with the CreateCustomUserTaskType service. All it takes is to insert the new type's Name. You can check the IDs of existing custom user task types with ListCustomUserTaskTypes; you'll need the ID in the next step.

Creating a custom user task template

Now that we've got custom user fields and user task (sub)types in place, let's create our user task templates. In these we will specify our custom fields “CustomUserTaskPhoto“ and “SpecialBarcode“ and add a Name, Description and whether it is Required.

{
"Name":"CustomUserTaskTemplatePhoto",
"Description":"A user task template for creating photos",
"TypeID": "11", // The UserTaskSubTypeID
"Options": {
"DefaultPriority": 5,
"DefaultDeadlineMinutes": 120,
"UserTaskField":{
"CustomFieldID":"9"
}
}
}

Designating user task priorities

As you can see in the chapter above, we've given the user tasks a priority of 5. What this means in practice however, all depends on how you setup your priority scale, which has its own set of services.

  • GetUserTaskPriorities
  • CreateUserTaskPriority
  • UpdateUserTaskPriority
  • DeleteUserTaskPriority

Additionally, the ListAvailableUserTasks returns the property PriorityDescription for your user tasks.

When calling GetUserTaskPriorities, the User Task details are fetched and the User Task Priority is translated into a PriorityDescription. The LanguageID and CountryID filters are compared against the user context requesting this information, and the UserTaskTypeID, UserTaskSubTypeID and Priority are taken from the User Task itself. The Priority from the User Task will be compared against the specified From and To ranges. The Description will be used to describe the priority, but if left empty, it will fall back to Name.

A priority scale is best shown by means of an example:

LanguageFromToDescription
NLStandaard
NL10Spoed
DE10Unwichtig
Default
EN10Unimportant
EN1030Default
EN30Urgent

Note that the Note that the From priority is an inclusive lower bound, while To is the exclusive upper bound.

Creating a custom user task

Now we create the custom user task itself, which will reference the custom user task template and the custom field we created in the earlier step.

Bear in mind that with the creation of this task, it's actually kicked off straight away in the store employees' App.

{
"OrganizationUnitID": 9,
"CustomUserTaskTypeID":11,
"CustomUserTaskTemplateID":1,
"UserTaskField":{
"CustomFieldID":9,
"IsRequired":"true"
},
"Description":"This task requires you to take a picture of a satisfied customer.",
"Priority": 5
}

Voilá, your custom tasks should now show up in the Companion or Tasks App.

Scheduling the creation of your custom user task

You can also let EVA create your custom user tasks during intervals of your choosing. You can do so by creating the task via Scheduled tasks in Admin Suite.

Select the task ScheduleCustomUserTask and specify the following variables:

  • an interval via Cron;
  • the OrganizationUnitSetID where the tasks must be created;
  • the CustomUserTaskTemplateID in question.