Help needed for creating a Google-Maps-Embed-formula for a daily tour plan

Hi community,

I need a bit of help with a formula for the Google Maps Embed.
I have created a test doc

The Google Maps Embed offers the opportunity to work with origin, destination and waypoints. I collect all possible destinations with addresses in the table “Destinations” I create my tour plan for a day in the table “Tourday_Plan”. The target is, to get a complete tour map for one day.
My problem is, that the count of waypoints differs from day to day, so it needs a formula part like a sequence or similar. Additionally, the Google Maps Embed wants and origin and a destination (origin = waypoint 1 origin-address and destination is the last waypoint destination-address). Can anyone of you have a look on this problem and help me to get a formula? The formula should be part in the canvas field “Tourday_Plan_Map” in the table “Tour Days”.
Thank you in advance :slight_smile:

Hello @Matthias_Forster,

I edited your doc and added this formula to a canvas in the first “Tour”:

Directions(
  thisRow.Tourday_Plan.First().Origin.Address, 
  thisRow.Tourday_Plan.Last().Destination.Address, 
  thisRow.Tourday_Plan.Splice(thisRow.Tourday_Plan.Count(), 1).Destination.Address
)

The idea is to:

  1. Take the first point as the origin.
  2. Use the last point as the destination.
  3. Create a waypoint list from all intermediate points (destinations), excluding the last one. This is done using the Splice() formula to remove the last point.

I assumed that the point list is in the correct order. If not, you’ll need to sort it before using the First() and Last() formulas.

Additional Notes

  • Displaying the Map: If you only want to display the map, you don’t need a canvas column—you can show it directly as a column.
  • Setting Up a Template: If you still prefer to use a canvas column, you’ll need to set up a template and configure the “Value for new rows” option in the canvas column settings. This way, every new row created will automatically include the map.

Let me know if this works for you or if you need further clarifications!

Best regards
Arnhold

2 Likes

Simply: Wow!!! And many, many thanks for your time and your solution!!! You helped me a lot!
All the best
Matthias

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.