Field Maps is not passing a field parameter correctly to Survey123

348
2
Jump to solution
03-23-2023 02:02 AM
narmour1979
New Contributor

Hi,

I have been scratching my head on this one for a while.

I have created a URL to pass parameters from an asset layer to a Survey123 form when the field worker clicks on the asset in Field Maps.

The URL is:

https://survey123.arcgis.app?itemID=XXXXXXXXXXXXXXXXXXXXX&field:parentglobalid={GlobalID}&field:GIS_ID={GIS_ID}&field:AssetName={assetName}&field:surveyType=General
 

The parameter is passed correctly when I test the URL in Mapviewer; the Survey123 form launches with the Asset's parameters correctly populated. However, when I attempt to launch the survey form from Field Maps, the AssetName field is incorrectly populated with {assetName}, it seems to be taking the literal value  "{assetName}". All other parameters are correctly passed.

 

Many thanks in advance of any advice received!

0 Kudos
1 Solution

Accepted Solutions
narmour1979
New Contributor

Looks like the issue was caused by the use of Arcade to conditionally surface the URL... I had configured the web map pop up to show or hide the URL based on whether or not a number of attributes were filled out against the asset. The customer wanted some kind of way to ensure that these important attributes were filled out before the inspector has access to the inspection form. So the Arcade expression basically returns a blank string ("") in place of a URL to the hyperlink if any of the required fields are empty, and returns the URL in the opening post above to the inspection form if the fields are all filled in. I think the problem arises at this point, the URL is passed from the expression without querying the attribute fields for the values to be passed, and the placeholder {assetName} is passed as a string.

View solution in original post

2 Replies
ChristopherCounsell
MVP Regular Contributor

Try:

  • upgrading to the latest version across the board (generally solves things magically)
  • Passing the parameters with URL encoding from field maps

If the above two fail, can you share the XLSForm so we can have a proper look?

0 Kudos
narmour1979
New Contributor

Looks like the issue was caused by the use of Arcade to conditionally surface the URL... I had configured the web map pop up to show or hide the URL based on whether or not a number of attributes were filled out against the asset. The customer wanted some kind of way to ensure that these important attributes were filled out before the inspector has access to the inspection form. So the Arcade expression basically returns a blank string ("") in place of a URL to the hyperlink if any of the required fields are empty, and returns the URL in the opening post above to the inspection form if the fields are all filled in. I think the problem arises at this point, the URL is passed from the expression without querying the attribute fields for the values to be passed, and the placeholder {assetName} is passed as a string.