Recommendations for automation for creating multiple rows

I have three tables:
1. MEMBERS - a list of names and details.
2. GROUP - a list of groups that members are part of (1:1).
3. DISTANCE - a list of distances between members and group, for each member there will be many rows, each with a distance to a group.  This "is part of" the MEMBERS table.

The intention is to create - for each member - a list of distances to groups, then using that list to find nearest groups and show within the member record etc.

Automations I have tried (including using solutions proposed by @Steve in his excellent post ) all, eventually, fail to execute.  Some run then fail, others don't start. 

I'd appreciate suggestions, ideas and hopefully example apps showing how the desired behaviour can a be met.  I'm not so concerned about fixing the current approach, more interested finding a way forward even if a different approach will work better.

Following examples are intended to better explain the goal.
Step 1. New row added to MEMBER table (by a separate bot)
Step 2. "add related distances" bot triggered by ADD action to MEMBER table - bot cycles through creating rows for each waitinglistID/groupID and calculated distance, using the LatLong data from the MEMBER and GROUP tables.

  • The full GROUP table runs to 26 rows.
  • The full MEMBER table run to ยฑ350 rows, but after the initial set up just 3 or 4 rows a day might be added.
  • memberAddCount is part of the automation I have tried from this post .
  • I have "Trigger other bots" set.

MEMBER table

waitingListID <key>memberID memberFirstNamememberLatLongmemberAddCountRelated DISTANCEs
228283a92673171Harley50.833731, -1.0719373<list>
7c75b1172735787Aiden50.829442, -1.0674643<list>
cf0332ba2789742Joel50.832267, -1.0744363<list>

GROUP table

groupID <key>groupNamegroupLatLong
7890ed95104th Portsmouth50.82838,-1.070168
e3c99d861st Portsmouth Sea Scouts50.79198,-1.109098
880dad9d21st Portsmouth50.801932,-1.076515

DISTANCE (is_part_of MEMBER)

distanceID
<key>
waitingListIDgroupIDdistance
aacdf65d228283a97890ed951
b013b53d228283a9e3c99d860.9
c11d0782228283a9880dad9d2.4
1897e69d7c75b1177890ed953.2
d50382bd7c75b117e3c99d868.4
2ebdc94f7c75b117880dad9d10
9fbf8f0ccf0332ba7890ed9541.5
0de76f3bcf0332bae3c99d863.2
46e54caacf0332ba880dad9d5.4
Solved Solved
1 6 232
1 ACCEPTED SOLUTION

You are welcome. There could be a few options to explore. 

In the following implementation, I have added three columns in the Groups table, each one of which references the Members table.

Suvrutt_Gurjar_0-1723823616213.png

As an example [member_1] column has the following settings. [member_2] and [Member_3] have identical settings.

Suvrutt_Gurjar_2-1723823773218.png

Then there are three additional virtual columns in the Groups table

[Member_1_Distance] ,[Member_2_Distance] and [member_3_Distance]

Suvrutt_Gurjar_3-1723823845796.png

Each of the columns have similar expressions for example [member_3_Distance] has an expression of 

Suvrutt_Gurjar_4-1723823977264.png

[member_2_Distance] and [Member_1_Distance] have similar expressions.

Then once the user selects three different members in the 3 member reference columns in the Groups table, their respective distances for that particular group are computed in the three virtual columns of distance.

Suvrutt_Gurjar_5-1723824159992.png

In this arrangement, the groups table will continue to be of 26 rows and at a time distance of 3 members can be calculated.

You could implement some variations of this approach depending on your need. In multi user environment this implementation will become more complex as you may need to bring in current logged in user element in the picture.

 

 

 

 

View solution in original post

6 REPLIES 6
Top Labels in this Space