Select to view content in your preferred language

Callback with rupdateFeature return Layer unvailable

700
4
Jump to solution
09-14-2023 11:44 AM
Rémy_Gourrat
Regular Contributor

Hi,

i do the same thing that this post About Callback by @DavidHood_USFS and @DougBrowning 

i work online with field maps and i use the featurelayer that i want update in the callback in my map.

i can call this featurelayer in browser with the same user that use for fieldmap

but each time after field maps is calling i have a field maps message : "the specified layer is unvalaible"

 i use field maps on Android 13 and Windows 11 : i can catch the featurelayer url and it's running...


var callback = {
callback: url_callback + "&itemID=" + webmap_itemid + "&featureSourceURL=" + feature_url
}
var callbackid = "featureID=" + fglobalid;
var callbackattributes = "featureAttributes={'myfield':" + $feature["myfield"] + "'}";

return url_source + UrlEncode(params) + "&" + UrlEncode(callback) + "%26" + UrlEncode(callbackid) + "%26" + UrlEncode(callbackattributes);

have you an idea to get the issue ?

thanks for you help

Rémy

 

 

0 Kudos
2 Solutions

Accepted Solutions
Rémy_Gourrat
Regular Contributor

thanks for your interest,

my webmap and feature layer are in arcgis enterprise but i think it's not the issue.

my arcade code :​

 

var related_records = FeatureSetByRelationshipName($feature, "myclassrelationame");
var cnt = Count(related_records);

var url_source = 'https://survey123.arcgis.app?';
var survey123_itemid = 'e09d39b6bff3484a846f4d65fbadcfcb';
var webmap_itemid = '21e4294ec9474cc2b28e7a108c155753';
var feature_url = "https://mydomain/arcgis/rest/services/z_test/myfeaturelayer/FeatureServer/3";
var url_callback = "https://fieldmaps.arcgis.app?referenceContext=updateFeature"
var fglobalid = $feature["globalid"];

if (cnt == 0) {
	var params = {
	  itemID: survey123_itemid,
	  action: 'collect',
	  'field:bati_local_guid': fglobalid,
	};
}
else {
	var params = {
	  itemID: survey123_itemid,
	  action: 'edit',
	  folder: 'inbox',	  
	  'q:where': 'local_guid=\'' + fglobalid + '\'',
	  update: 'true'
	};
}

var callback = {
    callback: url_callback + "&itemID=" + webmap_itemid + "&featureSourceURL=" + feature_url
}
var callbackid = "featureID=" + Mid(fglobalid,1,36);
var callbackattributes = "featureAttributes={'local_txt':'" + $feature["local_txt"] + "'}";

return url_source + UrlEncode(params) + "&" + UrlEncode(callback) + "%26" + UrlEncode(callbackid) + "%26" + UrlEncode(callbackattributes);

 

 

View solution in original post

0 Kudos
Rémy_Gourrat
Regular Contributor

Crazy thing ! why ?!? 😫

in this documentation  ArcGIS Field Maps : Deploy 

in this sample :

Initiate updating a feature

Note: This does not apply to table rows.

 

it's my case !! i tried to updateFeature in Field Maps on a table with callback just after validate in survey123...

 

View solution in original post

4 Replies
DougBrowning
MVP Esteemed Contributor

I am not seeing this part in there?  ?referenceContext=updateFeature

I also do not see a value for feature_url does it end in something like /0 to tell field maps what layer?

Just a few guesses. 

0 Kudos
Rémy_Gourrat
Regular Contributor

thanks for your interest,

my webmap and feature layer are in arcgis enterprise but i think it's not the issue.

my arcade code :​

 

var related_records = FeatureSetByRelationshipName($feature, "myclassrelationame");
var cnt = Count(related_records);

var url_source = 'https://survey123.arcgis.app?';
var survey123_itemid = 'e09d39b6bff3484a846f4d65fbadcfcb';
var webmap_itemid = '21e4294ec9474cc2b28e7a108c155753';
var feature_url = "https://mydomain/arcgis/rest/services/z_test/myfeaturelayer/FeatureServer/3";
var url_callback = "https://fieldmaps.arcgis.app?referenceContext=updateFeature"
var fglobalid = $feature["globalid"];

if (cnt == 0) {
	var params = {
	  itemID: survey123_itemid,
	  action: 'collect',
	  'field:bati_local_guid': fglobalid,
	};
}
else {
	var params = {
	  itemID: survey123_itemid,
	  action: 'edit',
	  folder: 'inbox',	  
	  'q:where': 'local_guid=\'' + fglobalid + '\'',
	  update: 'true'
	};
}

var callback = {
    callback: url_callback + "&itemID=" + webmap_itemid + "&featureSourceURL=" + feature_url
}
var callbackid = "featureID=" + Mid(fglobalid,1,36);
var callbackattributes = "featureAttributes={'local_txt':'" + $feature["local_txt"] + "'}";

return url_source + UrlEncode(params) + "&" + UrlEncode(callback) + "%26" + UrlEncode(callbackid) + "%26" + UrlEncode(callbackattributes);

 

 

0 Kudos
Rémy_Gourrat
Regular Contributor

Crazy thing ! why ?!? 😫

in this documentation  ArcGIS Field Maps : Deploy 

in this sample :

Initiate updating a feature

Note: This does not apply to table rows.

 

it's my case !! i tried to updateFeature in Field Maps on a table with callback just after validate in survey123...

 

DougBrowning
MVP Esteemed Contributor

ugg.  I have to say it is getting really old that Esri keeps treating tables differently!  I just do not get it.  Businesses always have more tables than layers.  Bummer.

0 Kudos