Select to view content in your preferred language

FM URL encoding to open S123, Callback and field edit

274
1
10-07-2024 11:45 AM
CristianGraf
Emerging Contributor

 

Hi all!

We are trying to make this work again..

From FM, we open S123 and pass several fields (Working). Once the Form is completed, it bring us back to FM and get an error "The specific layer is not available".

I did validate every source are all is fine. This one is a related table that we need to upsdate one field.

All of this services are hosted.

Any idea of what can go wrong?

Arcade

var S123urlsource = 'arcgis-survey123://?itemID=75cce9a7fb774f1bbcf81a59f32aa7da&field:rel_objectid='+$feature.OBJECTID+'&field:rel_globalid='+$feature.GlobalID+'&field:no_vanne='+$feature.NoGeomatique+'&field:rue='+$feature.Rue+'&field:no_chambre='+$feature.NoCV+'&callback:submit=';
var FMurlsource='https://fieldmaps.arcgis.app?';
var FMparams='itemID%3Debaefa9f41d246ea84d4c5986fe6ded5%26referenceContext%3DupdateFeature%26featureSourceURL%3Dhttps://services6.arcgis.com/soNIh8USuioRwjks/arcgis/rest/services/Inspections_CV_Vannes_VdM/FeatureServer/2%26';
var FMGID= Mid($feature.GlobalID,0,36);
var FMAtt='%26featureAttributes%3D%7B%22Inspection%22:%22Oui%22%7D';
return Concatenate([S123urlsource,UrlEncode(FMurlsource),FMparams,'featureID%3D',FMGID,FMAtt]);
 
URL Encoded
"arcgis-survey123://?itemID=75cce9a7fb774f1bbcf81a59f32aa7da&field:rel_objectid=9743&field:rel_globalid=6669430a-67e2-416d-957d-4b16167d642b&field:no_vanne=5038347&field:rue=chemin de la Côte-Saint-Luc &field:no_chambre=10021348&callback:submit=https%3A%2F%2Ffieldmaps.arcgis.app%3FitemID%3Debaefa9f41d246ea84d4c5986fe6ded5%26referenceContext%3DupdateFeature%26featureSourceURL%3Dhttps://services6.arcgis.com/soNIh8USuioRwjks/arcgis/rest/services/Inspections_CV_Vannes_VdM/FeatureServer/2%26featureID%3D6669430a-67e2-416d-957d-4b16167d642b%26featureAttributes%3D%7B%22Inspection%22:%22Oui%22%7D"
 
0 Kudos
1 Reply
DougBrowning
MVP Esteemed Contributor

If you just do &callback=https://fieldmaps.arcgis.app it will flip back to Field Maps and keep the state of the app you had already.  No need to give it all that other info or it will just reload it all on you.  I have never needed to encode it either it works just fine without it.

Hope that helps

0 Kudos