web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Collections and Custom...
Power Apps
Unanswered

Collections and Custom Connectors: the headers I need are in a sub-area of the response body

(0) ShareShare
ReportReport
Posted on by 31

I've made a custom connector that queries the EPA's REST service, but I'm having trouble parsing the correct data out of the response. The API definition includes a "summary" flag, but no matter whether it's used or not, the response body results are summary statistics for the query and a query identifier (QID), followed by the *actual* data I need.

 

 

{
 "Results": {
 "Message": "Success",
 "QueryRows": "5",
 "IndianCountryRows": "0",
 "SVRows": "0",
 "CVRows": "0",
 "V3Rows": "2",
 "FEARows": "1",
 "InfFEARows": "0",
 "INSPRows": "1",
 "TotalPenalties": "$963,531",
 "BadSystemIDs": "string",
 "QueryID": "245",
 "PageNo": "1",
 "Facilities": [
 {
 "RCRAName": "string",
 "SourceID": "ALR040033",
 "RCRAStreet": "string",
 "RCRACity": "string",
 "RCRAState": "string",
 "RCRAStateDistrict": "string",
 "RCRAZip": "string",
 "RegistryID": "110020837601",
 "RCRACounty": "string",
 "RCRAEPARegion": "string",
 "FacFederalAgencyName": "EPA",
 "RCRALandTypeCode": "string",
 "FacDerivedHuc": "552968",
 "FacFIPSCode": "55001",
 "FacIndianCntryFlg": "string",
 "RCRAIndianCntryFlg": "string",
 "FacIndianSpatialFlg": "Y",
 "FacDerivedTRIbes": "Cherokee Nation",
 "FacUsMexBorderFlg": "Y",
 "FacSICCodes": "811",
 "RCRANAICS": "8111",
 "FacLat": "38.803076",
 "FacLong": "-77.085951",
 "RCRAUniverse": "string",
 "Tsdf": "string",
 "CleanupActionFlag": "string",
 "RCRAStatus": "string",
 "AIRIDs": "DC0000001100195254",
 "CWAIDs": "DC0000001",
 "RCRAIDs": "VAD981111784",
 "RmpIDs": "110000",
 "SDWAIDs": "DC0000001",
 "TRIIDs": "20011FRTTT5001F",
 "SemsIDs": "string",
 "RCRAComplStatus": "string",
 "RCRASNC": "string",
 "RCRAQtrsWithNC": "8",
 "RCRAViolationTypes": "string",
 "RCRAQtrsWithSNC": "string",
 "RCRAOldestOpenVioDate": "string",
 "RCRAInspCnt": "0",
 "RCRADaysLastInspection": "1247",
 "RCRALastInspectionDate": "string",
 "RCRALastInspDateEPA": "string",
 "RCRALastInspDateState": "string",
 "DateLastRecordReview": "string",
 "FacTRILandReleases": "11.7",
 "FacTRIOffSiteTransfers": "string",
 "FacDerivedWBD": "20700100204",
 "FacDerivedWBDName": "Fourmile Run-Potomac River",
 "RCRAImpWaterFlg": "string",
 "ChesapeakeBayFlag": "Y",
 "RCRAIeaCnt": "0",
 "RCRAFeaCnt": "0",
 "RCRALastIeaDate": "string",
 "RCRALastIeaDateState": "string",
 "RCRALastIeaDateEPA": "string",
 "RCRALastFeaDate": "string",
 "RCRALastFeaDateState": "string",
 "RCRALastFeaDateEPA": "string",
 "RCRAPenalties": "$987",
 "RCRALastPenaltyDate": "12/12/2016",
 "Over80CountUs": "3",
 "PctilePctpre1960Us": "14.6",
 "PctileDpmUs": "99",
 "PctileCancerUs": "99",
 "PctileRespUs": "99",
 "PctileTrafficScoreUs": "92",
 "PctileProximityNPDESUs": "23.7",
 "PctileProximityNplUs": "96",
 "PctileProximityRmpUs": "91",
 "PctileProximityTsdfUs": "82",
 "PctileO3Us": "94",
 "PctilePmUs": "93",
 "FacPopulationDensity": "9611.17",
 "FacPercentMinority": "45.379",
 "EPASystem": "ICP",
 "Statute": "CWA",
 "RCRATRIbalLandCode": "string",
 "FacFederalAgencyCode": "E",
 "RCRACaseIDs": "string",
 "FacTRIReporter": "B",
 "FacTRIOnSiteReleases": "string",
 "FacMapFlg": "Y",
 "FacMapIcon": "CWA-NC-MJ-2.png",
 "LastViolationDate": "5/13/2011",
 "CurrentVioCnt": "string",
 "RCRAFIPSCode": "string",
 "RCRAMapIcon": "string",
 "RCRA3yrComplQtrsHistory": "________VVSS",
 "CensusBlockGroup": "110010096022",
 "MaxPctileUs": "98",
 "EjscreenFlagUs": "string",
 "EjscreenFlag": "string",
 "TRIbalFlag": "1",
 "CurrSvFlag": "0",
 "ViolFlag": "1",
 "CurrVioFlag": "0",
 "Insp5yrFlag": "1",
 "Ea5yrFlag": "0",
 "Infea5yrFlag": "0",
 "Lower48": "Y",
 "ActiveLower48": "string",
 "CollectionMethod": "ADDRESS MATCHING-HOUSE NUMBER",
 "ReferencePoint": "ENTRANCE POINT OF A FACILITY OR STATION",
 "CalculatedAccuracyMeters": "50",
 "Map": "string",
 "WebDocs": "C6",
 "FacCountyName": "Fairfax County",
 "FacStdCountyName": "Fairfax County",
 "ChemNamesRelLand": "string",
 "OwnerCode": "string",
 "OwnerDesc": "Local Government",
 "OperatorCode": "string",
 "OperatorDesc": "string",
 "RCRAinfoLandTypeCode": "string",
 "RCRAinfoLandTypeDesc": "string",
 "Score": "1",
 "MaxScore": "1"
 }
 ],
 "MapOutput": {
 "QueryID": "245",
 "IconBaseURL": "https://echo.epa.gov/app/map/icons/",
 "PopUpBaseURL": "https://echodata.epa.gov/echo/cwa_rest_services.pop_up?p_id=",
 "MapData": [
 {
 "LAT": "38.798026",
 "LON": "-77.062981",
 "ICON": "CAA-IC-MN-N.png",
 "TYPE": "Facility",
 "NAME": "VIRGINIA CONCRETE ALEXANDRIA PLANT",
 "PUV": "110001891506",
 "RCRAstatus": "________VVSS",
 "LastInsp": "901",
 "FormalCount": "1",
 "InformalCount": "1"
 }
 ]
 }
 }
}

 

 

 

The data I need is in the "Facilities" portion of the response body.

 

I've tried using PowerAutomate  and ParseJSON with some limited success, but the issue there is trying to pass the values I need (live latitude and longitude) from Power Apps then to the custom connector flow. I also have to use a modified version of my connector for the flow, or Power Automate attempts to parse null values as a type and throws an error.

 

And here is the "On Start" formula I'm using:


ClearCollect(Locations, 'U.S.EPAEnforcementandComplianceHistoryOnline(ECHO)-ResourceConservationandRecoveryAct'.Getradius({p_med: "R", p_pidall: "Y", p_lat: Location.Latitude, p_long: Location.Longitude, p_radius: "5", tablelist: "Y",maplist: "Y",qcolumns: "1,2,3,4,5,7,9,8,11,20,21,22,23,24,25,27,30,48,65,72,93,94,95,96,98,100,102"}))

Which creates this collection:

SescoDev_0-1690509020257.png

 

 

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard