GeoEvent Field Mapper - from flat to multicardinality

218
6
a month ago
SpatialSean
New Contributor III

I have a flat dataset that needs to be shifted into multicardinality for the output but am struggling with what syntax needs to be used within the field mapper to go from the 1 to many.

 

I need to take my fields such as language, event, urgency, and effective and then map them to be included into "info" - It may take multiple sets of field mappings to get it correct.

I've gotten as far as knowing there needs to be a '.' in the field mapper else it fails. For example trying to push the string 'Weather' as a category which is also a many.

 

SpatialSean_0-1711716865780.png

 

 

{
   "identifier": "123456789",
   "status": "Actual",
   "msgType": "Alert",
   "scope": "Public",
   "sent": "2019-05-28T13:49:09+0000",
   "info": [
      {
         "language": "en",
         "event": "Test Basic Custom Feed Event",
         "urgency": "Immediate",
         "severity": "Minor",
         "certainty": "Observed",
         "description": "This is a sample description",
         "headline": "Sample Headline",
         "web": "http://www.everbridge.com/",
         "effective": "2019-05-28T13:49:08+0000",
         "category": [
            "Transportation",
            "Local Disaster"
         ],
         "area": [
            {
               "areaDesc": "25 Corporate Drive Burlington, MA",
               "polygon": [
                  "-71.07593,42.50798 -71.20801,42.59766 -71.30529,42.55079 -71.31828,42.52278 -71.07593,42.50798"
               ]
            }
         ]
      }
   ]
}
  "language": "null",
  "event": "Late March Storm System for Plains and Midwest - Snow 3",
  "urgency": "null",
  "severity": "null",
  "certainty": "null",
  "effective": "Sat Mar 23 07:00:00 EDT 2024",
  "expires": "Wed Mar 27 19:00:00 EDT 2024",

 

0 Kudos
6 Replies
Gene_Sipes
New Contributor III

I can give you an example of what mine looks like. Here is a snip from my JSON feed. You can see that the rental uris property is multi-cardinal with a link for iOS and Android. 

Gene_Sipes_0-1711719337762.png

 

So... in the mapper it looks like this when trying to specify that I want to map the iOS link to the rental_ios feild in my feature service, as well as the android link. 

Gene_Sipes_1-1711719445546.png

 

SpatialSean
New Contributor III

Thanks Gene.  Maybe I was too many steps into it

Here is how my data is leaving the field mapper currently:

 

 

{
  "GED_Name": "Risk-IN",
  "identifier": "43311",
  "sent": "Mon Apr 01 13:40:24 EDT 2024",
  "status": "Actual",
  "msgType": "Alert",
  "category": "null",
  "headline": "<p>A bunch of info html coded text for details</p><p>Rain Threat:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Range, 2-4 in<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Impacts: High water, Washouts, Road closures, River flooding</p>",
  "description": "Another really long block of text",
  "scope": "null",
  "language": "null",
  "event": "Early-Week Severe Weather for the Central U.S. - Rain 1",
  "urgency": "null",
  "severity": "null",
  "certainty": "null",
  "effective": "Sun Mar 31 19:00:00 EDT 2024",
  "expires": "Wed Apr 03 07:00:00 EDT 2024",
  "web": "null",
  "resourceDesc": "null",
  "uri": "null",
  "areaDesc": "Early-Week Severe Weather for the Central U.S.",
  "polygon": {
    "rings": [
      [
        [
          -76.96959699999996,
          39.28723100000008
        ],
        [
          Removing to make this easier to read   ]
      ]
    ],
    "spatialReference": {
      "wkid": 4326
    }
  },
  "area": "null"
}

 

 

 

 I want Category to be this since it is multi cardinal

 

 

 

{
  "GED_Name": "Risk-IN",
  "identifier": "43311",
  "sent": "Mon Apr 01 13:40:24 EDT 2024",
  "status": "Actual",
  "msgType": "Alert",
  "category": ["Weather"],
  "headline": "<p>A bunch of info html coded text for details</p><p>Rain Threat:<br/>&nbsp;&nbsp;&nbsp;&nbsp;Range, 2-4 in<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Impacts: High water, Washouts, Road closures, River flooding</p>",
  "description": "Another really long block of text",
  "scope": "null",
  "language": "null",
  "event": "Early-Week Severe Weather for the Central U.S. - Rain 1",
  "urgency": "null",
  "severity": "null",
  "certainty": "null",
  "effective": "Sun Mar 31 19:00:00 EDT 2024",
  "expires": "Wed Apr 03 07:00:00 EDT 2024",
  "web": "null",
  "resourceDesc": "null",
  "uri": "null",
  "areaDesc": "Early-Week Severe Weather for the Central U.S.",
  "polygon": {
    "rings": [
      [
        [
          -76.96959699999996,
          39.28723100000008
        ],
        [
          Removing to make this easier to read   ]
      ]
    ],
    "spatialReference": {
      "wkid": 4326
    }
  },
  "area": "null"
}

 

 

 

 I am unsure how in field mapper what syntax is needed to get it at an array:

SpatialSean_0-1711994383897.png

 

0 Kudos
Gene_Sipes
New Contributor III

Without seeing your entire setup (mappers, calculators, etc) it's hard to tell what you are trying to do. From these two screenshots, your source fields do not match the incoming json feed properties. For example, you show a source field called DISCUSSION that has a substring method called on it. Where does that come from?

0 Kudos
SpatialSean
New Contributor III

Cutting down from the data in to only show the first 10,000 or 50,000 characters.

 

SpatialSean_0-1711995680191.png

SpatialSean_1-1711995734683.png

 

On my Target I have a field category that is a string and multicardinality.  I want to push the word 'Weather' into it but on the field mapper I am unsure what that syntax is.

Currently I have it written as . + 'Weather' on the field mapper which outputs as:

  "category": "null",

 What I want it to result in is:

 "category": ["Weather"],

 

0 Kudos
Gene_Sipes
New Contributor III

Try something like:
category[0] = "Weather"

Sorry, that's all I got at the moment. 

SpatialSean
New Contributor III

Thank you for all the ideas - no luck.  The furthest I got was using a field calculator and attempting the function array('Weather'), however, the array function is not available.  Might have to create a custom processor

0 Kudos