Skip to main content

Hi,

I would like to be able to read the name of the layers from AGOL that are shared with the same group. ArcGISOnlineConnector reads only the genaral name.

image

Correct. The ArcGISOnlineConnector retrieves the item name from Portal. If you want to get the layer names from the service, you need the service url. This attribute (_webservice_url) can be retrieved from the ArcGISOnlineConnector. You can then use the url in a HTTPCaller to get the contents of the service. You can use the same webconnection as for the ArcGISOnlineConnector. You only need to add the query string parameter f = json to get json. You can then fragment and flatten the response with json["layers"]

  • to get the layernames.


  • Correct. The ArcGISOnlineConnector retrieves the item name from Portal. If you want to get the layer names from the service, you need the service url. This attribute (_webservice_url) can be retrieved from the ArcGISOnlineConnector. You can then use the url in a HTTPCaller to get the contents of the service. You can use the same webconnection as for the ArcGISOnlineConnector. You only need to add the query string parameter f = json to get json. You can then fragment and flatten the response with json["layers"]

  • to get the layernames.

  • Hi, I think I managed to do some of the steps you mentioned.

    imageHowerver, _json_response field is missing the information about the layer name. I should have "A5WTCS2_RAM_C_Centreline_Ln_01"

     

    {"id": "a8c773f8c75d4353a54b97e8490697ae", "owner": "x.x@x", "created": 1697543079384, "isOrgItem": true, "modified": 1699886711664, "guid": null, "name": "1620016278_Mainline_Centreline", "title": "A5WTCS2_RAM_C_Centreline_Ln", "type": "Feature Service", "typeKeywords": "ArcGIS Server", "Data", "Feature Access", "Feature Service", "Metadata", "providerSDS", "Service", "Hosted Service"], "description": "<div style='text-align:left;'><p><span style='font-size:12pt;'><b>CAD Model:\\u00a0</b></span><span style='font-size:16px;'>X-718736-PH2B-0800-Chainage v1.0</span></p><p><span style='font-size:16px;'><b>Converted:\\u00a0</b>17/10/2023</span></p></div>", "tags": ""], "snippet": "", "thumbnail": "thumbnail/thumbnail.png", "documentation": null, "extent": [-7.490085703273247, 54.569679640849934], -7.274980822826842, 54.79065897132162]], "categories": ], "spatialReference": "29900", "accessInformation": "", "licenseInfo": "", "culture": "en-gb", "properties": null, "advancedSettings": null, "url": "https://......../services/Hosted/1620016278_Mainline_Centreline/FeatureServer", "proxyFilter": null, "access": "shared", "size": 73693, "subInfo": 0, "appCategories": ], "industries": ], "languages": ], "largeThumbnail": null, "banner": null, "screenshots": ], "listed": false, "numComments": 0, "numRatings": 0, "avgRating": 0, "numViews": 450, "groupCategories": ], "scoreCompleteness": 40, "groupDesignations": null}

     

    image


    Hi, I think I managed to do some of the steps you mentioned.

    imageHowerver, _json_response field is missing the information about the layer name. I should have "A5WTCS2_RAM_C_Centreline_Ln_01"

     

    {"id": "a8c773f8c75d4353a54b97e8490697ae", "owner": "x.x@x", "created": 1697543079384, "isOrgItem": true, "modified": 1699886711664, "guid": null, "name": "1620016278_Mainline_Centreline", "title": "A5WTCS2_RAM_C_Centreline_Ln", "type": "Feature Service", "typeKeywords": "ArcGIS Server", "Data", "Feature Access", "Feature Service", "Metadata", "providerSDS", "Service", "Hosted Service"], "description": "<div style='text-align:left;'><p><span style='font-size:12pt;'><b>CAD Model:\\u00a0</b></span><span style='font-size:16px;'>X-718736-PH2B-0800-Chainage v1.0</span></p><p><span style='font-size:16px;'><b>Converted:\\u00a0</b>17/10/2023</span></p></div>", "tags": ""], "snippet": "", "thumbnail": "thumbnail/thumbnail.png", "documentation": null, "extent": [-7.490085703273247, 54.569679640849934], -7.274980822826842, 54.79065897132162]], "categories": ], "spatialReference": "29900", "accessInformation": "", "licenseInfo": "", "culture": "en-gb", "properties": null, "advancedSettings": null, "url": "https://......../services/Hosted/1620016278_Mainline_Centreline/FeatureServer", "proxyFilter": null, "access": "shared", "size": 73693, "subInfo": 0, "appCategories": ], "industries": ], "languages": ], "largeThumbnail": null, "banner": null, "screenshots": ], "listed": false, "numComments": 0, "numRatings": 0, "avgRating": 0, "numViews": 450, "groupCategories": ], "scoreCompleteness": 40, "groupDesignations": null}

     

    image

    You need to have _webservice_url not _private_url.

     

    You can enable this in the ArcGISOnlineConnector in the Attributes to Add section.


    Hi, I think I managed to do some of the steps you mentioned.

    imageHowerver, _json_response field is missing the information about the layer name. I should have "A5WTCS2_RAM_C_Centreline_Ln_01"

     

    {"id": "a8c773f8c75d4353a54b97e8490697ae", "owner": "x.x@x", "created": 1697543079384, "isOrgItem": true, "modified": 1699886711664, "guid": null, "name": "1620016278_Mainline_Centreline", "title": "A5WTCS2_RAM_C_Centreline_Ln", "type": "Feature Service", "typeKeywords": "ArcGIS Server", "Data", "Feature Access", "Feature Service", "Metadata", "providerSDS", "Service", "Hosted Service"], "description": "<div style='text-align:left;'><p><span style='font-size:12pt;'><b>CAD Model:\\u00a0</b></span><span style='font-size:16px;'>X-718736-PH2B-0800-Chainage v1.0</span></p><p><span style='font-size:16px;'><b>Converted:\\u00a0</b>17/10/2023</span></p></div>", "tags": ""], "snippet": "", "thumbnail": "thumbnail/thumbnail.png", "documentation": null, "extent": [-7.490085703273247, 54.569679640849934], -7.274980822826842, 54.79065897132162]], "categories": ], "spatialReference": "29900", "accessInformation": "", "licenseInfo": "", "culture": "en-gb", "properties": null, "advancedSettings": null, "url": "https://......../services/Hosted/1620016278_Mainline_Centreline/FeatureServer", "proxyFilter": null, "access": "shared", "size": 73693, "subInfo": 0, "appCategories": ], "industries": ], "languages": ], "largeThumbnail": null, "banner": null, "screenshots": ], "listed": false, "numComments": 0, "numRatings": 0, "avgRating": 0, "numViews": 450, "groupCategories": ], "scoreCompleteness": 40, "groupDesignations": null}

     

    image

    the _json_response has been generated from _webservice_url and it does not include the information required

    imageAm I missing sth?


    Hi @marta.podsiad​,

    Have you tried using the ArcGIS Online Feature Service Reader instead of the ArcGISOnlineConnector? When you add the layer as a Reader Feature Type on the canvas, you can obtain the layer name by referencing the fme_feature_type attribute as shown in the following screenshot:

    imageI hope this does the trick?


    Hi, the problem with your approach is that Esri ArcGIS Online (AGOL) Feature Service reads only one published layer. I need to read all layers shared with particular group


    Hi @marta.podsiad​, I think both @nielsgerrits​ and you were on the right track earlier. I managed to get all the layers with a few tweaks:

    • setting the HTTPCaller Request URL to return a JSON response: @Value(_webservice_url)?f=pjson
    • used a JSONFragmenter to query the Layers from the _reponse_body and extract the layer names into attributes:
      • JSON Attribute: _response_body
      • JSON Query: jsonÂ"layers"]
      • Flatten Query Result into Attributes: Yes
      • Attributes to Expose: name

     

    2023-12-06_17-02-48Let me know if this helps.


    Hi @marta.podsiad​, I think both @nielsgerrits​ and you were on the right track earlier. I managed to get all the layers with a few tweaks:

    • setting the HTTPCaller Request URL to return a JSON response: @Value(_webservice_url)?f=pjson
    • used a JSONFragmenter to query the Layers from the _reponse_body and extract the layer names into attributes:
      • JSON Attribute: _response_body
      • JSON Query: jsonÂ"layers"]
      • Flatten Query Result into Attributes: Yes
      • Attributes to Expose: name

     

    2023-12-06_17-02-48Let me know if this helps.

    I am really sorry but it does not work. There is sth wrong with HTTP Callerimage 

     


    I am really sorry but it does not work. There is sth wrong with HTTP Callerimage 

     

    The error indicates that the service requires authentication. You need to configure the HTTPCaller to use a web connection. You can use the same web connection as you use on the ArcGISOnlineConnector.

     

    2023-12-12_15h45_53


    Reply