How to auto generate records in related tables

1212
7
11-28-2021 09:31 PM
Labels (2)
AbidHiraSaath
New Contributor III

Dear All,

We are trying to create a system to evaluate the performance of existing bus transit routes in a city. As a sample, we can consider the following case:

AbidHiraSaath_0-1638163260462.png

The bus goes from A to B to C and Returns from C to B to A 2 times every day. Our field workers will be sitting in the bus and monitoring the number of passengers who climb aboard and exit at each stop using field maps, as shown the following table:

AbidHiraSaath_1-1638163353279.png

This table is related to the points marked in the map. At the same time, we also have another table that is related to the lines, containing data about the time taken for each trip and number of passengers on each trip. The blank table is shown below:

AbidHiraSaath_2-1638163498545.png

So what we would like to do is that every time data is added to the table related to the points (i.e. information about the bus stops) a new record should get generated in the table about the bus routes. So when the field workers sitting in the bus add information about how many people got in and out at stop B, and the start and stop times, this table should automatically generate a record of the information for the path between A and B.

@XanderBakker  @BlakeTerhune Tagging you here because I have seen your comments on similar posts in the past. 

 

7 Replies
BlakeTerhune
MVP Regular Contributor

Do you need the route table updated immediately (real-time) when the data is entered into the stop table or can it it be updated at regular intervals (5 minutes, 1 hour, nightly, etc)?

0 Kudos
AbidHiraSaath
New Contributor III

HI Blake, Thanks for Replying.

It would be ideal, if the route table was updated immediately.

0 Kudos
BlakeTerhune
MVP Regular Contributor

My first thought is to build a simple web app (ArcGIS JS API) to use for entering data in the stop table. That would be a good place to build the logic for simultaneously updating the route table. If that's not possible, maybe look into Setting up an attribute rule in ArcGIS Pro.

0 Kudos
AbidHiraSaath
New Contributor III

@BlakeTerhuneThe thing is, we need to collect data through field maps, since the field teams are going to be using mobile devices. I am not sure that it would be possible for them to operate the webapp on the phones

0 Kudos
BlakeTerhune
MVP Regular Contributor

If you're using an enterprise geodatabase (on an RDBMS), you could create a database trigger on the stop table to automatically insert the records into the route table. These are a bit clunky but it should work.

0 Kudos
AbidHiraSaath
New Contributor III

Hi,

We are working on ArcGIS online. The relationship structures are made in arcgis pro and uploaded to the online organization, where data collection is happening on Field Maps. Can you guide me to any literature on whether these database triggers can work in this type of system?

 

Thanks a lot for taking the time out to reply!

0 Kudos
BlakeTerhune
MVP Regular Contributor

It's possible to run a Python script triggered by an action in ArcGIS Online, like when a new record is created.

Send Email When a Feature is Added to an ArcGIS On... - Esri Community

Solved: Re: Sending email on feature service edit - Esri Community

Instead of sending an email, maybe you could have the Python script insert a new row into your related table.

0 Kudos