Forum Academy Marketplace Showcase Pricing Features

Cannot get waypoint order - been trying for weeks and pulling my hair out

Hi there.

I’m looking for somebody that can help me with a repeating group, which are stored in the database and are geographic addresses. I have tried various plugins and Google Directions plugin to no avail.

Ideally what I need is for a button (Optimize) to be clicked and then the Repeating Group Re-orders based on the best route/optimized waypoint order.

I’d be most greatful if anybody can assist with this as I’ve now been stuck for quite some time.

Google Routes API is what you’d need

Hi Doug.

Thank you for your response.
I have set this up and it returns the data request with everything seemingly fine.

The main issue i’m having is that it will only give me the value of waypoint order is 0.

It just wont seem to optimize or output an actual order for some reason

@dereksparkeswindowcl You got any screen shots you can show me?

1 Like

Of some code or something?

Ive taken some screenshots, however if theres anything else at all you would need to see to help me figure it out I will happily send. Honestly this has driven me to the edge of insanity

Doesn’t the request have to have longitude and latitude? From first glance the API call is not entirely set up correctly.

1 Like

I’m honestly not sure. I wouldn’t have thought so as the api is returning the lat & long, it seems to recognise as the waypoints, origin/address are geographic addresses. But I could most definitely be wrong

Any idea what the API setup should be? I’ve strugled with their API documentation.

On the API connector I have a single address listed, however the actual addresses im trying to calculate are from a repeating group, the one in the work planner screenshot

For starters it needs to be a POST request and it looks like you might be using the directions endpoint but you’d need to use the routes endpoint

1 Like

Thank you. I will give this a try now. Thank you for your help. I appreciate it so very much

That’s assuming you do a routes api key setup in your google dahsboard

Yes I have just set up the Routes API ( I didn’t have this one) and just trying to understand/work out the documentation now

This API is something I can’t understand. It’s like the language it uses is different. I can’t even get it to connect

Do you have any idea which part im getting wrong?

Yea, you’ll need to manually write out your request in your JSON body below instead of specifying parameters. For any dynamic values you’ll use <some_var_name>

It’s our no-code language vs. their code language :laughing:

But yea what @doug.burden said, it’s wants a JSON body (like every API does)

Right now you’re putting everything in the Parameters section instead of typing out the JSON body

Oh man, well beyond my brain. I’ve got no chance. I’ve spent 2 weeks trying to work it out with Google Directions API only to learn it was the wrong thing to use. At this point my brain has collapsed. My problem is I don’t understand this codes stuff or JSON. It took me days and days to get the Directions API just to connect

Give me a few with it and I’ll work up a solution for you to try. Just copy and paste kind of stuffs.

1 Like

I really appreciate that. I know I can’t do this just working it out, I know my own limitations. Is there anything you need me to do that may help?

Hold my beer. We’re goin in.