SETFORMATTRIBUTES

Configure specific device functionality and behaviors at the form level.

Description

Allows you to configure specific device functionality and behaviors at the form level. These configuration options help you control what features the user has available, improving the workflow and data quality for that particular form. You can currently control the following:

  • Disable adding photos from the camera roll
  • Force record to be sync’d upon save
  • Control the minimum accuracy required for the GPS location
  • Disable the ability to manually move the record location
  • Disable the “Save as Draft” feature
  • Control photo and video quality settings

The following table contains the available properties that be set:

PropertyTypeDescriptionDefault
auto_sync_enabledbooleanauto-sync this record after savinguser-preference
auto_location_enabledbooleanauto-populate the record locationtrue
auto_location_minimum_accuracyintegerminimum accuracy in meters for the auto-populated location1500
manual_location_enabledbooleanallow manually changing the record locationtrue
media_gallery_enabledbooleanallow media from the gallery or camera rolltrue
media_capture_enabledbooleanallow media from the cameratrue
photo_qualityintegermaximum dimension of photos in pixels, or 'native'user-preference
video_qualitystringvideo resolution, one of: 480p, 720p, 1080p, 2160p (device/platform dependent)user-preference
drafts_enabledbooleanallow saving record as a drafttrue
edit_locations_enabledbooleantrack the locations of record editstrue
edit_durations_enabledbooleantrack the durations of record editstrue

Parameters

config Object (required) - A configuration object with the following optional properties

Examples

ON('load-record', function() {
  // This is just an example, it's not required to specify properties you don't want to override.
  var config = {
    auto_sync_enabled: true,
    auto_location_enabled: true,
    auto_location_minimum_accuracy: 10,
    manual_location_enabled: false,
    media_gallery_enabled: false,
    media_capture_enabled: true,
    photo_quality: '2048',
    video_quality: '720p',
    drafts_enabled: false,
    edit_locations_enabled: true,
    edit_durations_enabled: true
  };

  SETFORMATTRIBUTES(config);
});