参数

XLSForm 中的某些问题类型具有额外参数,允许您控制调查中问题的样式或行为。 在某些情况下,这些参数补充了问题类型支持的外观。 并非所有参数在所有提交应用程序(Survey123 Mobile、Survey123 外业应用程序和 Survey123 Web 应用程序)中均受支持。 有关应用程序支持的详细信息,请参阅下面的参数表,这些表按问题类型以及调查工作表中接受每个参数的 XLSForm 列进行了组织。

您可以通过用空格分隔参数来将问题的多个参数添加到同一列。 例如,范围问题可以在 body::esri:style 列中包含 startColor、endColor 和 color 参数,如下所示:

startColor=Orange endColor=White color=#FF6347

常规

本部分介绍了您可以在多个问题类型的 bind::esri:parameters 和 body::esri:style XLSForm 列中使用的参数。

下表描述了您可以在 text、integer、decimal、note、date、time、dateTime、select_one、select_multiple、geopoint、calculate 和 hidden 问题类型的 bind::esri:parameters XLSForm 列中使用的参数。

bind::esri:parameters

参数描述提交应用程序
calculationMode

控制何时执行问题中的计算。

值:auto | manual | always | whenEmpty

例如:

calculationMode=manual
calculationMode=always

Web 应用程序

外业应用程序

下表介绍了您可以在 text、integer、decimal、select_one(带有 autocomplete 外观)、select_multiple(带有 autocomplete 外观)* 和 barcode 问题类型的 body::esri:style XLSForm 列中使用的参数。

body::esri:style

参数描述提交应用程序
placeholderText

指定当问题为空时,将显示在问题输入区域中的文本。

值:@[hint] | @[guidance_hint]

例如:

placeholderText=@[hint]
placeholderText=@[guidance_hint]

Survey123 Mobile

外业应用程序

*仅 Survey123 Mobile 支持。

音频

下表描述了您可以在 audio 问题类型的 bind::esri:parameters XLSForm 列中使用的参数。

bind::esri:parameters

参数描述提交应用程序
编解码器

指定音频录制的首选编解码器。 可以提供多个编解码器,以逗号分隔。 将使用与设备兼容的第一个编解码器。

值:<codec name>

示例:

codec=amr-nb,aac

Survey123 Mobile

外业应用程序

fileName

指定文件名。

值:<expression>

例如:

fileName=concat("JobID-", ${job_id})
fileName=concat(${asset_id}, "_", 
  format-date(now(), "%Y%m%d%H%M%S"))

Web 应用程序

max-duration

指定音频录制的最大持续时间(以秒为单位)。 Web 应用程序中的默认持续时间为 600(10 分钟)。

值:<seconds>

示例:

max-duration=45

Survey123 Mobile

Web 应用程序

外业应用程序

max-size

指定音频录制的最大文件大小(以兆字节为单位)。 外业应用程序中的默认大小为 10 MB。

值:<megabytes>

示例:

max-size=5

Survey123 Mobile

外业应用程序

条形码

下表描述了您可以在 barcode 问题类型的 body::esri:style XLSForm 列中使用的参数。

body::esri:style

参数描述提交应用程序

barcodeType

指定用户可以扫描的条形码类型。 可以提供多个类型并以逗号分隔。 如果未提供 barcodeType 参数,则可以扫描所有受支持的条形码类型,aztec、code39、datamatrix、maxicode 和 pdf417 除外。

值:all | 1d | 2d | <barcode types>

  • all - 所有受支持的类型,code39 和 pdf417 除外。
  • 1d - 所有一维类型,code39 除外。
  • 2d - 所有二维类型,pdf417 除外。

一维类型:codabar | code128 | code39 | code93 | ean13 | ean8 | itf | upca | upce | upceanextension

二维类型:aztec | datamatrix | maxicode | pdf417 | qrcode | rss14 | rssexpanded

例如:

barcodeType=qrcode,aztec,code128
barcodeType=ean8,itf
barcodeType=2d
barcodeType=pdf417

外业应用程序

文件

下表描述了您可以在 file 问题类型的 bind::esri:parameters XLSForm 列中使用的参数。

bind::esri:parameters

参数描述提交应用程序
fileName

指定文件名。

值:<expression>

例如:

fileName=concat("JobID-", ${job_id})
fileName=concat(${asset_id}, "_", 
  format-date(now(), "%Y%m%d%H%M%S"))

Web 应用程序

max-size

指定最大文件大小(以兆字节为单位)。 默认设置为 10 MB。

值:<megabytes>

示例:

max-size=5

Web 应用程序

群组

下表描述了您可以在 begin group 问题类型的 body::esri:style XLSForm 列中使用的参数。

body::esri:style

参数描述提交应用程序

backgroundColor

borderColor

设置组或页面的背景和边框颜色。 有关详细信息,请参阅组、页面和重复颜色。

值:<HTML color name> | <hex color code>

例如:

backgroundColor=LightBlue
borderColor=#4682B4
backgroundColor=#C7FFC7 borderColor=#3C6D9E

Survey123 Mobile

外业应用程序

布局

设置组的格网布局样式。

值:dynamic-grid | fixed-grid

示例:

layout=fixed-grid

外业应用程序

图像

本部分介绍了您可以在 image 问题类型的指定 XLSForm 列中使用的参数。

下表描述了您可以在 bind::esri:parameters XLSForm 列中使用的参数。

bind::esri:parameters

参数描述提交应用程序
allowAdds

编辑现有记录时禁用添加新图像。

值:false

示例:

allowAdds=false

外业应用程序

fileName

指定文件名。

值:<expression>

例如:

fileName=concat("JobID-", ${job_id})
fileName=concat(${asset_id}, "_", 
  format-date(now(), "%Y%m%d%H%M%S"))

Web 应用程序

外业应用程序

max-size

指定最大文件大小(以兆字节为单位)。 默认设置为 10 MB。

值:<megabytes>

示例:

max-size=5

Web 应用程序

smartAnnotation

对于具有注记外观的图像问题,自动在检测到的对象周围生成标注的注记图像和边界框。 追加这些属性以定义注记的样式和格式。

必需属性:<model_name>

可选属性:minScore | cameraPreview | label | class | boundingBoxes | outlineWidth | fontSize | font | bold | italic

例如:

smartAnnotation=modelname
  &cameraPreview=true&minScore=0.52
smartAnnotation=modelname&
  cameraPreview=true&minScore=0.52
  &class=classname1,classname2
  &label=false&bold=true

外业应用程序

smartAttributes

执行对象检测或图像分类并在调查中使用 EXIF 结果。

必需属性:<model_name>

可选属性:minScore | cameraPreview | label | class

例如:

smartAttributes=modelname
  &cameraPreview=true&minScore=0.45
smartAttributes=modelname
  &cameraPreview=true
  &class=classname1,classname2
  &label=false

外业应用程序

redaction

自动生成或手动添加边界框并在目标区域应用涂黑效果。

必需属性:<model_name> | @faces | @manual

可选属性:minScore | cameraPreview | label | class | effect | symbol | fillColor | scale

例如:

redaction=modelname
  &cameraPreview=true&effect=blur
redaction=@manual&effect=blockout
redaction=@faces&cameraPreview=true
  &class=classname1,classname2
  &label=false@effect=symbol&symbol=🐻

外业应用程序

watermark

topLeftWatermark

topCenterWatermark

topRightWatermark

leftCenterWatermark

centerWatermark

rightCenterWatermark

bottomLeftWatermark

bottomCenterWatermark

bottomRightWatermark

指定图像水印的位置。 追加属性以定义内容和格式。 有关详细信息,请参阅水印。

属性:text | color | outlineColor | outlineWidth | haloColor | size | font | bold | italic | margin | image | imageSize

例如:

watermark="Example Text
  &outlineColor=White"
bottomLeftWatermark="Example Text
  &bold=true"
topRightWatermark="@[latitude longitude]
  &size=20"

外业应用程序

下表描述了您可以在 image 问题类型的 body::esri:style XLSForm 列中使用的参数。

body::esri:style

参数描述提交应用程序
allowRename

指定用户是否可以手动编辑文件名。

值:true | false

示例:

allowRename=false

外业应用程序

fileNameVisible

指定文件名是否在调查中可见。

值:true | false

示例:

fileNameVisible=true

外业应用程序

footerText

对于带有签名外观的图像问题,指定要在签名弹出窗口底部显示的文本。 如果未指定值,可将问题的指导提示显示在签名下方。 可以使用 footerText=@[hint] 将上述内容更改为问题提示。

值:<none> | @[hint]

例如:

footerText
footerText=@[hint]

Survey123 Mobile

外业应用程序

方法

指定图像问题的捕获方法。 map 值仅支持带有注释外观的图像问题。

值:browse | camera | map

例如:

method=camera
method=map
method=browse,camera,map

Web 应用程序

外业应用程序

palette

对于具有绘图或注释外观的图像问题,需指定自定义绘图工具面板。

值:<palette name>

示例:

palette=SiteLayout

外业应用程序

previewHeight

选择图像后,设置图像预览的高度。 如果您希望图像预览以最大尺寸显示且没有多余空白,请使用 previewHeight=0。

值:<lines> | <lines>lines | <percentage of screen height>% | <pixels>pixels

例如:

previewHeight=3lines
previewHeight=120pixels

外业应用程序

下表描述了您可以在 image 问题类型的 parameters XLSForm 列中使用的参数。

parameters

参数描述提交应用程序
max-pixels

对于图像问题,在最长边上设置图像的最大尺寸,保持原始纵横比。

对于带有签名外观的图像问题,指定签名弹出窗口的最大宽度。

对于具有绘图外观的图像问题,将画布设置为正方形 (1:1) 图像。

值:<pixels>

例如:

max-pixels=1500
max-pixels=400

Web 应用程序

外业应用程序

地图问题

下表介绍了您可以在 geopoint、geotrace 和 geoshape 问题类型的指定 XLSForm 列中使用的参数。

下表描述了您可以在 bind::esri:parameters XLSForm 列中使用的参数。

bind::esri:parameters

参数描述提交应用程序

geocode

设置定位器以返回地理编码结果。

值:<locator item ID>

示例:

geocode=36ff9e8c13e042a58cfce4ad87f55d19

Web 应用程序

外业应用程序

下表介绍了您可以在 geopoint、geotrace 和 geoshape 问题类型的 body::esri:style XLSForm 列中使用的参数。

body::esri:style

参数描述提交应用程序
height

设置图像预览的高度。

值:<lines> | <lines>lines | <percentage of screen height>% | <pixels>pixels

例如:

previewHeight=6lines
previewHeight=250pixels

外业应用程序

lineColor2

fillColor3

指定线或面要素的线和填充颜色。 此内容仅适用于 Survey123 中的地图预览。 有关详细信息,请参阅几何符号系统。

值:<HTML color name> | <hex color code>

示例:

lineColor=Black 
fillColor=#9EFFF5

Survey123 Mobile

外业应用程序

lineWidth2

指定线或面要素的线宽度(以像素为单位)。 此内容仅适用于 Survey123 中的地图预览。

值:<pixels>

例如:

lineWidth=3

Survey123 Mobile

外业应用程序

map

设置默认底图。

值:<map name> | <map item ID>

例如:

map="World Topography"
map=de26a3cf4cc9451298ea173c4b324736

Web 应用程序

外业应用程序

mapTools

控制适用于 geopoint、geotrace 和 geoshape 问题的地图工具。

值:search | mapSwitcher | zoom | home | locate

例如:

mapTools=zoom
mapTools=search,locate

外业应用程序

method2

指定捕获方法。 使用折点方法时,可以设置其他参数。

值:sketch | vertex

仅在外业应用程序中适用的其他折点值:streaming | beep | haptic | edit

例如:

method=vertex
method=vertex,streaming
method=vertex,streaming,haptic

Web 应用程序

外业应用程序

minCaptureZoomLevel

指定可以捕获几何的最低级别。

值:<integer>

示例:

minCaptureZoomLevel=17

Web 应用程序

overlay

在调查中的任何其他 geopoint、geoshape 或 geotrace 问题的重复中显示第一个 geopoint 问题的点位置。 追加属性以定义内容和样式。

值:<repeat name>

属性:view | preview | icon | iconColor | iconOutlineColor | iconSize | label | labelColor | labelOutlineColor | fontSize

例如:

overlay=campsites&preview=true
overlay=hydrants&label=asset_id&icon=hydrant&iconColor=Red

外业应用程序

precision

指定将在地图问题中采集的并在调查的单个响应面板中显示的小数位数。 如果未设置此参数,将在地图问题中采集所有可用的小数位数,但是仅在单个响应面板中显示六个小数位。

值:<integer>

示例:

precision=4

Web 应用程序

snapMode

指定捕捉行为。 点可以捕捉到其他要素,而线和面可以捕捉到其他要素或其自身。 仅当 method=vertex 时可用。

值:feature | self2

示例:

snapMode=feature
snapMode=self
snapMode=self,feature

Web 应用程序

symbol1

指定要用作地图上的点标记的 .png 文件。 追加属性以定义位置和比例。

值:<file name>.png

属性:x | y | scale

示例:

symbol=meter.png?x=0.6&y=0.1&scale=1.5

外业应用程序

1 - 仅受 geopoint 问题类型支持。

2 - 仅受 geoshape 和 geotrace 问题类型支持。

3 - 仅受 geoshape 问题类型支持。

多项选择问题

下表介绍了您可以在 select_one、select_multiple 和 rank 问题类型的 parameters XLSForm 列中使用的参数。

parameters

参数描述提交应用程序
randomize

随机化选择列表中的选择顺序。

值:true

示例:

randomize=true

Web 应用程序

外业应用程序

范围

本部分介绍了您可以在 range 问题类型的指定 XLSForm 列中使用的参数。 组合时,参数必须用空格分隔。

下表描述了您可以在 body::esri:style XLSForm 列中使用的参数。 有关详细信息,请参阅样式选项。

body::esri:style

参数描述提交应用程序

startColor

endColor

color

指定范围滑块的颜色:

  • 范围起点位置的滑块颜色。
  • 范围终点位置的滑块颜色。
  • 填充滑块起点和选定值之间空间的颜色。

值:<HTML color name> | <hex color code>

例如:

startColor=Blue endColor=Red
startColor=Orange endColor=White color=#FF6347
endColor=#262626 color=Yellow

Survey123 Mobile

Web 应用程序

外业应用程序

下表描述了您可以在 range 问题类型的 parameters XLSForm 列中使用的参数。 有关详细信息,请参阅范围滑块参数。

parameters

参数描述提交应用程序

start

end

step

指定范围滑块的起点、终点和步长值。

值:<integer> | <decimal>

例如:

start=0 end=50 step=5
start=10.25 end=1 step=0.25

Survey123 Mobile

Web 应用程序

外业应用程序

重复

本部分介绍了您可以在 begin repeat 问题类型的指定 XLSForm 列中使用的参数。

下表描述了您可以在 bind::esri:parameters XLSForm 列中使用的参数。

bind::esri:parameters

参数描述提交应用程序
allowAdds

允许添加新的重复记录。

值:true | false

示例:

allowAdds=true

外业应用程序

allowUpdates

允许修改现有的重复记录。

值:true | false

示例:

allowUpdates=false

外业应用程序

query

允许在表单中显示现有的重复记录。 指定其他查询参数以过滤可用记录。

值:<none> | "SQL statement"

例如:

query
query="severity='high'"

外业应用程序

下表介绍了您可以在 begin repeat 问题类型的 body::esri:style XLSForm 列中使用的参数。

body::esri:style

参数描述提交应用程序

backgroundColor

borderColor

设置重复的背景和边框颜色。 有关详细信息,请参阅组、页面和重复颜色。

值:<HTML color name> | <hex color code>

例如:

backgroundColor=LightBlue
borderColor=#4682B4
backgroundColor=#C7FFC7 borderColor=#3C6D9E

Survey123 Mobile

外业应用程序

addRecordMode

对于具有表格外观的重复,指定表格视图中添加记录按钮和复制到新记录选项的模式。 默认值为 row。 当值为 row 时,新记录将追加到表格视图中。 当值为 form 时,新记录将在表单视图中打开。

值:row | form

示例:

addRecordMode=form

Survey123 Mobile

editInFormView

对于具有表格外观的重复,在表格视图中显示或隐藏在表单视图中编辑选项。 默认值为 true。

注:

当重复存在错误时,即使 editInFormView 参数设置为 false,在表单视图中编辑选项也会启用。

值:true | false

示例:

editInFormView=false

Survey123 Mobile

copyToNewRecord

对于具有表格外观的重复,在表格视图中显示或隐藏复制到新记录选项。 此选项允许用户复制重复中的记录。 默认值为 true。 addRecordMode 参数决定如何添加重复记录。

值:true | false

示例:

copyToNewRecord=true

Survey123 Mobile

editInTabularView

对于具有表格外观的重复,启用或禁用表格视图中的编辑。 默认值为 true。 当值为 false 时,表格视图中的所有单元格均为只读。

值:true | false

示例:

editInTabularView=false

Survey123 Mobile

下表介绍了您可以在表格重复中问题的 body::esri:style XLSForm 列中使用的参数。

body::esri:style

参数描述提交应用程序

showInTabularView

对于具有表格外观的重复,在表格视图中将问题显示为一列。 默认值为 false。

值:true | false

示例:

showInTabularView=true

Survey123 Mobile

文本

本部分介绍了您可以在 text 问题类型的指定 XLSForm 列中使用的参数。

下表描述了您可以在 bind::esri:parameters XLSForm 列中使用的参数。

bind::esri:parameters

参数描述提交应用程序
geocode

对于具有地理编码外观的 text 问题,将定位器设置为在使用地理编码外观时返回地理编码结果。

值:<locator item ID>

示例:

geocode=36ff9e8c13e042a58cfce4ad87f55d19

Web 应用程序

外业应用程序

下表描述了您可以在 text 问题类型的 body::esri:style XLSForm 列中使用的参数。

body::esri:style

参数描述提交应用程序
defaultHeight

对于具有多行外观的文本问题,请设置文本框的初始高度。 文本框的高度将增加以容纳答案文本。

值:<number of lines>

示例:

defaultHeight=5

外业应用程序

indicator

对于具有地理编码外观的文本问题,允许地理编码结果显示相对于当前设备位置的方向和距离。

值:direction | distance | none

例如:

indicator=none
indicator=direction
indicator=direction,distance

外业应用程序

maxResults

对于具有地理编码外观的文本问题,指定要返回的最大结果数。 默认值为 6。

值:<number of results>

示例:

maxResults=10

Web 应用程序

外业应用程序

邻近分析

对于具有地理编码外观的文本问题,指定地理编码结果是否仅显示设备位置特定半径内的结果。

值:<distance>m | km | ft | mi | yd

例如:

proximity=3km
proximity=1000ft

外业应用程序

建议

对于具有地理编码外观的文本问题,更改建议的填充方式。 默认设置为是。

值:yes | no

示例:

suggestions=no

外业应用程序

测距仪

下表介绍了您可以在 text、integer 和 decimal 问题类型的 bind::esri:parameters XLSForm 列中使用的参数,以从测距仪检索值。

bind::esri:parameters

参数描述提交应用程序

measurement

对于具有测距仪外观的文本、小数或整数问题,设置要在问题中存储的测量值。 如果值包含空格,则将值列表包含在引号内。

值:height | azimuth | horizontalDistance | slopeDistance | inclination | multipleHeights

例如:

measurement=height
measurement=height,azimuth,horizontalDistance
measurement="multipleHeights,Height 1,Height 2"

外业应用程序