Query Widget Popup Config and Expressions

383
2
Jump to solution
10-31-2023 12:51 PM
kapalczynski
Occasional Contributor III

I have a pretty loaded question.... 

I have a webmap that has a custom popup with a couple expressions.  

If there is a related record in a FC then the Update Expression Link is displayed

If there is NO related record in a FC then the Add Expression link is displayed.

 

<div style="display:{expression/expr0};"><a href="arcgis-survey123://?itemID=4ebxxfd0f0xx284304e518&amp;portalUrl=https://xxx.gov/portalx&amp;action=edit&amp;folder=inbox&amp;update=true&amp;filter=REL_GLOBALID:{GLOBALID}&amp;callback=arcgis-fieldmaps://?itemID=7b9ba6cedxxx6e8dc5cec1d65" rel="nofollow ugc" target="_blank">Update OA-13 Inspection Form</a>
</div>
<div style="display:{expression/expr1};"><a href="arcgis-survey123://?itemID=4ebfdffxxx279284304e518&amp;field:REL_GLOBALID={GLOBALID}&amp;field:GEOGRAPHICAL_LOCATION={LATITUDE},{LONGITUDE}&amp;callback=arcgis-fieldmaps://?itemID=7b9ba6ced6bxxxdc5cec1d65" rel="nofollow ugc" target="_blank">Add OA-13 Inspection Form</a>

 

Update Expression:

 

// THIS SHOWS THE LINK IF THERE IS AN EXISTING RECORD
var globalIDValue = $feature.GLOBALID
var relGlobalIDValue = FeatureSetByName($map,"Update - OA 13 Inspection Form",['REL_GLOBALID'], false)
var status = "none"
for (var i in relGlobalIDValue) {
    var compareValue = Text(i.REL_GLOBALID)
    var currentValue = globalIDValue
    if (currentValue == compareValue){  
        status = "inline"
        }
}
return status

 

Add Expression

 

var globalIDValue = $feature.GLOBALID
var relGlobalIDValue = FeatureSetByName($map,"Add OA 13 Inspection Form",['REL_GLOBALID'], false)
//var status = "NO INSPECTION"
var status = "inline"
for (var i in relGlobalIDValue) {
    var compareValue = Text(i.REL_GLOBALID)
    var currentValue = globalIDValue
    if (currentValue == compareValue){  
        status = "none"
        }
}
return status

 

This works GREAT and can be clearly seen in the Popup below... where only one of them is shown at a time...In this case there is a related record for this Feature and as such it says Update for the second link "Update OA-13 Inspection Form"

If there was NOT a related record it would say "Add OA-13 Inspection Record"

kapalczynski_0-1698781433018.png

So everything is working Fantastic up to this point... But I then create a Web application and then add the Query Widget.  

=============================================

I configure the Query widget to " Use layer's pop-up configuration in the web map"

Is does this to a certain degree BUT the Expression is not read properly and ALWAYS displays BOTH of the links created via expressions..(See 2nd image below)

No matter what I do I cannot get the QUERY WIDGET to respect the Expressions in the WebMap Custom Config as specified int he Query Widget Config Settings.

THOUGHTS?

kapalczynski_1-1698781595447.png

 

kapalczynski_3-1698781761796.png

 

 

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
kapalczynski
Occasional Contributor III

FROM ESRI SUPPORT:

I appreciate you sharing the post and providing an excellent details! I understood you have a custom expression which works as expected in Map Viewer but when you create a web app builder using this map, the query widget in web app builder is not honoring this expression.

I went ahead and did some research and found that pop-up configurations made in ArcGIS Online Map Viewer are not compatible with ArcGIS Web AppBuilder. Furthermore, unfortunately, the behavior you are experiencing, looking at your post, seems to be a BUG-000108767: "The Web AppBuilder for ArcGIS Query widget's pop-up does not honor the pop-up configuration of the related table assigned in the ArcGIS Online web map". I can go ahead and attach this bug to our case and you can monitor the status of this bug.

View solution in original post

0 Kudos
2 Replies
kapalczynski
Occasional Contributor III

Maybe something I have to get with ESRI about?

0 Kudos
kapalczynski
Occasional Contributor III

FROM ESRI SUPPORT:

I appreciate you sharing the post and providing an excellent details! I understood you have a custom expression which works as expected in Map Viewer but when you create a web app builder using this map, the query widget in web app builder is not honoring this expression.

I went ahead and did some research and found that pop-up configurations made in ArcGIS Online Map Viewer are not compatible with ArcGIS Web AppBuilder. Furthermore, unfortunately, the behavior you are experiencing, looking at your post, seems to be a BUG-000108767: "The Web AppBuilder for ArcGIS Query widget's pop-up does not honor the pop-up configuration of the related table assigned in the ArcGIS Online web map". I can go ahead and attach this bug to our case and you can monitor the status of this bug.

0 Kudos