Geolocation problem
You should change data format to yyy-mm-dd
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
You should change data format to yyy-mm-dd
Thank you Maryna,
I've just done this, and it is still not passing information to the database. Was that what you meant?
Chris
Sorry, there is a typo.
You should pass data in format 'yyyy-mm-dd'. For example, 2014-04-13
THank you Maryna, I'm assuming you're asking me to change the format for the date picker on the start screen of the app? If so, it defaults to yy/mm/dd, and although I've tried to go with your suggestion it doesn't allow it.
When I'm in the test screen on the data_create_service it passes all the info across to the database in the right format. I just don't understand why it doesn't do the same in the app test environment!
Hello,
Please follow these steps:
1 Open data tab for the "startScreen".
2 Find "create_service" and click "Edit Mapping"
3 Navigate to "Request" tab.
4 Find "Date" parameter in request tab and click "Add JS". http://prntscr.com/3aqhpn/direct
5 JS editor appears. Fill it with following code: http://prntscr.com/3aqic0/direct
pre
return new Date(value).toISOString().replace(/T.*/gi, "");
/pre
Amazing, thank you so much! It is working perfectly now. Thank you again.
Chris
I am the biggest idiot going! All through the construction of this App, I've been using a dummy database to call on for the geolocation. I've just created a new database with the correct data in it, and now I can't get the app to work. It may be something completely simple (knowing me it is) but would you be able to advise me why it isn't working please?
Hi Chris.
Don't worry about it.
You have two ways to change db. And it's up to you what way you willing to choose.
1 Delete all services. And create new services with new db.
It means that if you choose this way you have to create all needed services and recreate and re-implemented all datasources for these services.
2 Just change DB settings for exists services. It's easy to implement. Follow this steps:
2.1 Open you new DB and navigate to "Settings" tab. Find "Database Id" and copy it for use in next steps. http://prntscr.com/3ckwo8/direct
2.2 Navigate to your App editor. And open "services"-YourDB__settings service. http://prntscr.com/3ckvar/direct
2.3 There would be "database_id" field in this service. Please populated it with your new (stored in first step) DB id.
Now your services will ask your new DB.
Note if your new DB has some data type modifications you should correct it in your services.
Otherwise your services would work as well as with previous DB.
Hi Igor,
Thank you for the speedy reply. One question though. I do have a settings service, but that is for a different page in my app that relates to a different DB. I don't have a settings service for the geolocation page. When I do a test in the "getCustomersWithinRange" service, I get the following error:
{
"status":"400 Bad Request",
"url":"https://api.appery.io/rest/1/code/fee...",
"response":"An error occured"
}
Any ideas?
Chris
Hello!
The problem is that you use server code which refers to specific DB id. If you use another DB, you have to change data there http://docs.appery.io/tutorials/build...