How to do user input?

1306
8
Jump to solution
06-27-2019 01:05 PM
Ramon_de_Leon
Occasional Contributor

Does anybody have a QuickCapture Designer workflow or sample JSON code for doing "user input" on a project?

Would like to be able to do a free text input on one of my data field (asset ID), I saw a Youtube video (@ 27:48) where it was implemented:

https://www.youtube.com/watch?v=JOnMdbrmA6w&t=2955s

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JohnathanHasthorpe
Esri Regular Contributor

Hi Ramon 

Please test drive our new documentation page on this - it has a description and some examples:

But note you must use the JSON editor in the designer to set this up. We will add this functionality into the designer UI in the future, but we are not quite ready yet.

Please let me know if you have any questions at all.

Thanks

John

View solution in original post

8 Replies
JohnathanHasthorpe
Esri Regular Contributor

Hi Ramon 

Please test drive our new documentation page on this - it has a description and some examples:

But note you must use the JSON editor in the designer to set this up. We will add this functionality into the designer UI in the future, but we are not quite ready yet.

Please let me know if you have any questions at all.

Thanks

John

Ramon_de_Leon
Occasional Contributor

Thanks Johnathan, the documentation was helpful and I was able to do the user input on the project. Just a minor confusion on my part being new to JSON, I first tried putting the user input tag codes before the preferences, didn't realize there was already one on the bottom ("userInputs": [],) where I need to put user input properties. Once, I figured that out it worked like a charm. First impression here in the office about the app is pretty positive, great alternative to Survey123 when you need to get things done fast on the field.

nelsmickaelson
New Contributor III

Can you share your json? I read the ESRI help and the examples are complex. I just need a simple comment box. Thank you!

0 Kudos
JohnathanHasthorpe
Esri Regular Contributor

Hi Nels 

Please paste the JSON below into a json editor to view it (e.g. JSONLint - The JSON Validator ) - this will help with the formatting. It is for a simple project with one button, that has a free text userInput with an id of "001" defined. The userInput value will be written to the routeNo field we a feature is captured:

{
"basemap": {
"type": null,
"itemId": null,
"required": true,
"shared": false,
"zoomLevel": null
},
"dataSources": [{
"featureServiceItemId": "7a8e1fb16b4747a497b87b81a5f533cb",
"dataSourceId": "c0c9a6d9-41aa-4711-bcf3-cc509a6520fa",
"url": "https://services9.arcgis.com/tMHw4nvIk1Ur5R5u/arcgis/rest/services/BasicTest/FeatureServer/0"
}],
"itemId": "15f8d5eacd2c4ebb80710089f374b683",
"preferences": {
"allowEditLocation": false,
"backgroundColor": "#f3f3f4",
"distanceThreshold": null,
"timeThreshold": null,
"horizontalAccuracy": 30,
"undoThreshold": 6,
"adminEmail": "ichivite@esri.com"
},
"templateGroups": [{
"backgroundColor": "#f3f3f4",
"columnSpacing": 12,
"expanded": true,
"label": "Points of Interest",
"labelColor": "#212121",
"labelFontSize": 16,
"name": "Points of Interest",
"rowSpacing": 12,
"templates": [{
"cameraInfo": {
"mode": "none",
"imageSize": "medium",
"required": true
},
"captureInfo": {
"continuous": false,
"exclusivityGroup": null,
"dataSourceId": "c0c9a6d9-41aa-4711-bcf3-cc509a6520fa",
"type": "esriGeometryPoint"
},
"displayInfo": {
"label": "Family",
"shape": "rectangle",
"size": "medium",
"color": "#ffffff",
"labelColor": "#212121",
"labelFontSize": 14,
"labelFontWeight": "Bold",
"outlineColor": "#333333",
"outlineWidth": 0,
"shadowColor": null,
"image": null
},
"fieldInfos": [{
"fieldName": "RouteNo",
"value": "${userInput:001}"
}],
"id": "c329a05e-a9e5-4d7d-ab7d-4bc234a455f5",
"key": null
}],
"outlineColor": "#E0E0E0",
"columns": 1
}],
"userInputs": [{
"id": "001",
"label": "Enter route number",
"fieldType": "esriFieldTypeString",
"required": true,
"domain": {
"type": "userDefined",
"name": "route no",
"inputMask": "",
"hint": "",
"codedValues": [],
"range": []
},
"mode": "project"
}],
"version": 0.1
}

I hope this helps.

Thanks

John

0 Kudos
nelsmickaelson
New Contributor III

Perfect! Thank you!

0 Kudos
BrianBulla
Occasional Contributor III

Hi Johnathan,

Is there a way to empty the string after a button has been clicked?  I'd like to use this as a way to allow the user to enter COMMENTS when needed, but it only happens occasionally.

0 Kudos
JohnathanHasthorpe
Esri Regular Contributor

Hi Brian

In the next release of the mobile app (1.2 to be released early October 2019), you will be able to configure user inputs that are launched after a button is pressed. This is perfect for capturing comments on a record by record basis. Note that this functionality will only be made available through the JSON editor for the time being. But we will document the process of setting it up. 

Thanks

John

MarkCooper5
Occasional Contributor II

Johnathan Hasthorpe  I have added a second user variable with a mode of 'button' and this allows me, once I have taken a photo, to add some information about that individual photo, rather than the whole project. This works really well and will be perfect for our Planning Officers going out on site visits where they will capture a number of photos/points per site but may want a quick description of what each photo is.

I did try and add a second variable with button mode but it did not appear to work. Is that by design?

Also, I saw on a different post of mine that you are looking to add an azimuth variable. This would be amazing. Do you know when this is likely to arrive? Also, will it still pick up from the phone if a bluetooth gps unit is configured for location?

0 Kudos