Having the option to search from favourite location instead of current location

Hi there.

Apologies if this isn't clear I'll do my best to explain. I've also attached my OML file.

I'm trying to create an option on the FJLocationList page to search FROM a location that I select as a favourite(as you can see with the star option) INSTEAD OF searching from my current location.

How would I do this?

Kind Regards

Hi! 

This filter of yours allows the user to see all the records from FJLocations that are the user favorites or nobody favorites

UserPreferences.UserId = GetUserId() or UserPreferences.Id = NullIdentifier() 

If you use erase the second condition like :

UserPreferences.UserId = GetUserId() 

 The user will see or search only the locations that are in his own favorites. 

Hope this helps 

Graça 

Stay Safe

Maria da Graça Peixoto wrote:

Hi! 

This filter of yours allows the user to see all the records from FJLocations that are the user favorites or nobody favorites

UserPreferences.UserId = GetUserId() or UserPreferences.Id = NullIdentifier() 

If you use erase the second condition like :

UserPreferences.UserId = GetUserId() 

 The user will see or search only the locations that are in his own favorites. 

Hope this helps 

Graça 

Stay Safe


Apologies I don't think I was clear enough I'll try again.

So you can see on my file how my mobile app can search USING my current location.


What I'm trying to do is :

if I click the favourite button on a location I want to be able to USE THAT FAVOURITE LOCATION to run a search for the records NEAREST TO THE FAVOURITE LOCATION.

Sorry, I hadn't understand. 

First you have to choose/build an action to determine the distance, I believe Google Maps have one but never used it, and from the forge you also have:
    Distance Between Coordinates -> web
    Distance From Coordinate -> mobile


Then process each record ( For each widget) to calculate the distance from the favorite to the location and update the list field. 

Use the "ListFilter" action or the "ListSort" to obtain the locations you want.  

The action should look something like

If you use in the "ListSort" the parameter Ascendind =False the first records will correspond to the nearest locations.

Hope this helps

Graça


Maria da Graça Peixoto wrote:

Sorry, I hadn't understand. 

First you have to choose/build an action to determine the distance, I believe Google Maps have one but never used it, and from the forge you also have:
    Distance Between Coordinates -> web
    Distance From Coordinate -> mobile


Then process each record ( For each widget) to calculate the distance from the favorite to the location and update the list field. 

Use the "ListFilter" action or the "ListSort" to obtain the locations you want.  

The action should look something like

If you use in the "ListSort" the parameter Ascendind =False the first records will correspond to the nearest locations.

Hope this helps

Graça


I'm not sure if you can see that on the OML file I sent but I already have this. 


How do I get the option to search USING a favourite location instead of current location? 

Kind Regards

You must have a list of the favourite locations (UserPreferences) . 

For that new list you can use an aggregate like the one already use in your list, but the filter will be like :

UserPreferences.UserId = GetUserId() 

 The user will see only the locations that are in his own favorites. 


Maria da Graça Peixoto wrote:

You must have a list of the favourite locations (UserPreferences) . 

For that new list you can use an aggregate like the one already use in your list, but the filter will be like :

UserPreferences.UserId = GetUserId() 

 The user will see only the locations that are in his own favorites. 


But I'm trying to get the app to give me the distance from a favourite Iocation INSTEAD OF using my current location to give the distance?


Here in the screen have you the favorite locations ? The User has to have a way to choose the favorite location he or she wants to use. You must have two lists the list of the locations you already have and a list or a combo box with the favorites, so he can choose the one favorite from witch to get the distance to each locations in the other lists . I don't see another way.

Maria da Graça Peixoto wrote:

Here in the screen have you the favorite locations ? The User has to have a way to choose the favorite location he or she wants to use. You must have two lists the list of the locations you already have and a list or a combo box with the favorites, so he can choose the one favorite from witch to get the distance to each locations in the other lists . I don't see another way.

Can you please include some pictures about what you are explaining here?

Kind Regards


The screen could look like (the yellow balloons are my comments)