Select to view content in your preferred language

Related tables and Python

120
2
Thursday
Rar_Katia
New Contributor II

New to Python, but learning. I have a survey built in Connect with repeats and I've been struggling with how to best visualize this data in an application.

Through a lot of reading up, I understand that repeats are represented as a related table linked to the feature service that the survey creates. What I'd like to do is query the related table using Python (I was able to find this Query Related Records documentation but can't figure out how to actually go from point A to point B). The goal being that the records in the related table are concatenated and display alongside their parent within an Experience Builder table. I understand the concept of Pandas, just not how to take the query URL and put that to use within the script. 

In prior iterations of this project I used Dashboard and Arcade to accomplish this and it worked quite nicely, but there's been a need to edit the feature service to update records from "Open" to "Closed" and so I'm using Experience Builder for its edit widget.

Are there any good examples where something similar has been done? Are there any example scripts out there that show how to go from a query to a geopandas table in Python? 

Thank you!

0 Kudos
2 Replies
HaydenWelch
Occasional Contributor II

@DanPattersonis very well versed in pandas to arcpy operations. He has a ton of blog posts on this forum about it and plenty of good open source repositories for you to peruse.

I'd definitely start there then come back here if you can't find an answer.

0 Kudos
DanPatterson
MVP Esteemed Contributor

@HaydenWelch ... numpy to arcpy

I don't do pandas since it is too bloated with the integration of numpy and arrow.

Numpy 2.0 introduces variable width strings plus a lot of enhancements... perhaps in a version or two of Pro 😉

Working with Arrays of Strings And Bytes — NumPy v2.0 Manual


... sort of retired...