Group a list of Users based on opted into Offers and their geographical distance

I have a Users and Offers data type. A user field contains their home address, along with some offers that they’ve subscribed to. Offers is another data type which contain some service offering from a local business.

My goal is to be able to group users who live within .5 miles from each other together if they’ve also subscribed to the same Offer.

I tried making a backend workflow to create a group number, loop through a user, find others who signed up for the same offer, and assign them to the same group if they are within 0.5 miles from this user. Then repeat this for all other users on the list.

The end result should be a repeating group (i think) which displays the various group numbers created, the offer, and the list of users in that group.

Open to ideas and examples of how to accomplish this instead of using a recursive workflow if possible.

This topic was automatically closed after 70 days. New replies are no longer allowed.