Hi!
I have a search box that allows someone to add a location to their profile. Currently, my website has around 30 users but those 30 users hit my google places API around 5000 times in one hour while accessing this feature. Does anyone have any times or ideas on what I can do?
Is there a way for me to cache locations or anything to reduce this bill?
Video of functionality
I have found that when you make the Data Source of a repeating group an api call it makes that call a ridiculous number of times. I would say to make the call once and save it as a custom state or something on page load. Then make that the Data Source for the repeating group. I would also love to know if anyone has found a different solution for using an api call as a data source in a repeating group. I think even if the repeating group is not visible it still makes the api call.
1 Like
I think what you can do is map the main searched points and save this data in a table or map the most searched locations and take all the points of these locations and save them in your table, when they want to get the data from your table.
To keep them updated, it runs some schedules during the day, for example twice a day, one in the morning and another in the afternoon, and it updates all the data that it has saved in its table in a single call.
Hi William,
So letâs say I have a geographic places searchbox + a repeating group that uses and/or displays results from that places searchbox.
You would advise to store the result of the searchbox in a group, and using that stored address to feed to the repeating group ?
For example, below I have a RG that filters parking spots using the âare within x kms of searchbox valueâ. It would be preferable to have something like ""are within x kms of group stored address from searchbox value ?
@thibautranger
My previous response in this thread was really just a suggestion to solve why their users were using the API 5000 times in one hour because it did not make sense for that to happen just based on the users individual inputs.
In your case, if you find the API is being called excessively, you could add a workflow to âWhen SearchBox Addressâs Value is changedâ then set a custom state to the page or any element that is of type âgeographic addressâ and set the state to the searchboxâs value. Then in your repeating group add a conditional to say when the custom state value is not empty, then set the data source to include the address constraint and point it to the custom state instead of the search box.
Then you could add another conditional for if the custom state is empty then hide the element or use a default value for the geographic address.
Also could set the state on page load to current userâs location so that could be the default and then you donât need the conditionals on the RG because you know on page load it will be fulfilled.