2

I am downloading a survey data from survey123.com by using GIS services however I am not able to create a widget on webapp to show it on ArcGIS webapp. I am not familiar with ArcGIS but here is the script I have written:

from arcgis.gis import GIS
import pandas as pd
def main():
    gis = GIS("organization","id","password")
    #search for the feature layer/service
    featureLayer_item = gis.content.search(query="owner:" + gis.users.me.username,
                                    item_type="Feature Layer",
                                    max_items=15)

    feature_layers = featureLayer_item[0].layers
    flayer = feature_layers[0]
    sdf = pd.DataFrame.spatial.from_layer(flayer)
    return sdf

if __name__  == "__main__":
    main()

If I run this code on PyCharm I am able to get results and see them, I tried it in different formats as well such as Excel, CSV. But I have no idea how to connect this script's output to webapp to see the points on the map.

5
  • I may be wrong but can't you simply add the layer you are collecting information into in survey 123 as a layer in a web map and then add that web map into the web app builder? So no need to be running any python script?
    – Hornbydd
    Commented Jun 1, 2021 at 10:03
  • I am trying to create a script that can retrieve information from some predetermined API'S and show it on the map. Since i had survey123 access and i was able to retrieve data from there, i basically wanted to use it as a test. But could not make it work. The main idea is to retrieve data information from an api and to be able to see it on webapp. @Hornbydd
    – Fatih Enes
    Commented Jun 1, 2021 at 10:13
  • Well you would need to upload it back onto ArcGIS Online as a layer then add it to a web map which you use in Web app builder. Well that's my understanding, hence me saying do you really need to download it? Try it?
    – Hornbydd
    Commented Jun 1, 2021 at 13:10
  • Yes, I am thinking the same, but i would like to do it with python code if it is possible, is there any way to upload it back as a layer and then call web app to import it. (with code of course) I am going through the document to understand but I am not familiar at all with ArcGis. @Hornbydd
    – Fatih Enes
    Commented Jun 2, 2021 at 4:50
  • You probably need to read this and this.
    – Hornbydd
    Commented Jun 2, 2021 at 9:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.