Select to view content in your preferred language

Hide empty field in Popup

1495
7
03-16-2022 01:53 AM
Vakhtang_Zubiashvili
Occasional Contributor III

Hi all,

I am trying to hide empty field in Popup, i used ArcadeExpression:

IIF (IsEmpty($feature.Location), "", "block");

and jQuery:

$('table.esri-widget__table tr').each(function(){
            if($(this).children('td:empty').length === $(this).children('td').length){
              $(this).remove(); // or $(this).hide();
            }
});

 but none of them works. 

How can i hide fields "tr" in popup table? Any new idea?

 

Thanks 

0 Kudos
7 Replies
JayantaPoddar
MVP Esteemed Contributor

Is "tr" the fieldname?

In Arcade, try 

IIF (IsEmpty($feature["tr"]), "None", "block");

 Hide Field in Pop-up Using Arcade - Esri Community



Think Location
0 Kudos
Vakhtang_Zubiashvili
Occasional Contributor III

hi,

no, "tr" is a table raw. I changed 

IIF (IsEmpty($feature["tr"]), "None", "block");

but does not work.

0 Kudos
BlakeTerhune
MVP Regular Contributor

Either your field value is not empty (maybe a space or something) or you're not adding the expression to the display property of the html style of the element. See step 8 in this guide:

Hide Field in Pop-up Using Arcade - Esri Community

0 Kudos
Vakhtang_Zubiashvili
Occasional Contributor III

hi,

so, i add expression like this:

  spopupTemplate = {
            content: [{
              type: "fields", // Autocasts as new FieldsContent()
              // Autocasts as new FieldInfo[]
              fieldInfos: [{
                fieldName: "expression/ნიშნული"
              }, {
                fieldName: "expression/ჩაღრმავება"
              },{
                fieldName: "expression/წყლის დონე"
              }]
            }],
            // autocasts to ExpressionInfo class
            expressionInfos: [{
              name: "ნიშნული",
              title: "ნიშნული",
              expression: "IIF (IsEmpty($feature.Location), '', 'block');"
            },
            {
              name: "ჩაღრმავება",
              title: "ჩაღრმავება",
              expression: "$feature.CaRrmaveba"
            },
            {
              name: "წყლის დონე",
              title: "წყლის დონე",
              expression: "$feature.wylis_done"
            }]
          };
0 Kudos
Kishore
Occasional Contributor

@Vakhtang_Zubiashvili 

Try following:

expressionInfos: [{
              name: "ნიშნული",
              title: "ნიშნული",
              expression: "IIF (IsEmpty($feature.Location), 'None', 'inline');"
            }]
Regards,
Kishore
0 Kudos
Vakhtang_Zubiashvili
Occasional Contributor III

Thanks kishore,

but look what result i get:

Screenshot (55).png

it sets values, it does not hides empty value row 😞

0 Kudos
SumitZarkarCT
New Contributor III

Please check how you have configured the POP-UP it will work in case of custom popups only and if you have edited the html. Please check if you have followed step 6-8 correctly from the link

If possible please share the popup configuration

0 Kudos