Configuring Categorized Files Tabs in FSM Mobile
Combine these fragments with the supplied configuration and the account's existing rules. Keep the other resources and conditions in each matching rule. For more information, see Selecting Resources.
An ordinary Files tab can have a child labeled Files (Internal). The child reuses files and supplies filecategory: "INTERNAL". Use this option in the Files elements, read mapping, and search. Adding the option to a resource rule alone doesn't classify files.
First, merge this fragment into the supplied routes/mobile.files definition. It adds the category fields and selection logic, and inherits the upload input, native file identity, asset mapping, and event attachment defaults.
This example selects FSM uploads for the current event and employee, with the inherited asset matching. It replaces the Files search with that folder scope, including for the ordinary Files view. Native attachments stored elsewhere and project reference documents require additional selection branches. Those branches are outside this example. Folder selection also avoids relying on the native file join that is unavailable for project tasks.
{
"routes/mobile": {
"files": {
"element": {
"description": {
"hidden": "${ options.filecategory != undefined }",
"required": "${ options.filecategory == undefined }",
"value": "filecategory.value + userdescription.value"
},
"filecategory": {
"type": "text",
"hidden": true,
"readonly": true,
"value": "${ options.filecategory != undefined ? '[' + options.filecategory + '] ' : '' }"
},
"userdescription": {
"type": "text",
"label": "Description",
"column": 2,
"pattern": "^[^\\r\\n]+$",
"hidden": "${ options.filecategory == undefined }",
"required": "${ options.filecategory != undefined }",
"value": ""
}
},
"article": {
"filters": [
[
"formulatext:case when {folder} like '${ event.id }-%-${ user.internalid }' then 'T' else 'F' end",
"is",
"T"
],
"and",
[
[
"formulatext:'${ options.filecategory == undefined ? 'T' : 'F' }'",
"is",
"T"
],
"or",
[
"description",
"contains",
"[${ options.filecategory || '' }] "
]
]
],
"map": {
"userdescription": "formulatext:regexp_replace(regexp_replace({description}, '[\\r\\n]*{[^}]*}$', ''), '^\\[[^\\]]*\\] ', '')"
}
}
}
}
}
Then include these entries in the resources object of the matching CRM task rule at routes/mobile.event.article.task.resources. The same arrangement can be used in a matching project task rule under .projecttask.resources.
{
"array": true,
"parent": [
"files"
],
"files": [
{
"id": "files-1",
"label": "Files (Internal)",
"parent": "files",
"filecategory": "INTERNAL"
}
]
}
The following table shows how the configuration uses each value.
|
Value |
Configuration Behavior |
|---|---|
|
|
Becomes |
|
Hidden |
Builds |
|
|
Captures the technician's text and is required in a categorized view. |
|
|
Combines the prefix and text, for example |
|
|
Removes the capture-metadata trailer and the first bracketed prefix when reopening the file, leaving the editable text. |
|
|
Applies the folder scope and the bracketed category match. Without a category option, the category restriction is bypassed. |
The supplied file operation adds its capture-metadata trailer after the combined description. Editing the user description recalculates the combined value and retains the selected category. An ordinary Files view keeps its usual description input and can also contain categorized files.
The categorized examples use single-line descriptions. The current file-update operation can retain old text when updating an existing multiline description. The pattern prevents creating multiline descriptions in these views. Resolve this limitation before enabling description editing for files with existing multiline descriptions.
Use fixed category tokens consistently in the instance options and report filters. Changing a token doesn't recategorize existing files. Existing descriptions must follow the same prefix convention to be selected and restored correctly.
The Files (Internal) label and description filter don't create an access-control boundary. History, reports, and notifications have their own file selection.