Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Can Appery.io dynamically create new pages from unique database Id's?

Hi, I would like to use google places api results to have Appery.io dynamically create a new page from unique ID's sent from google places JSON responses to Appery backend. Is this possible?

I have the my search field results populating a grid with JSON response from Google places. Each object in the array response has a unique id from google. I would like to have each unique Id, that is associated with each google place, be stored in the DB along with the location name when it is clicked in the search results. After this info is stored,(which I know is possible but I am still working on how to parse the responses in local storage properly.. I think..) I would like a new page created from that google location id that was stored in DB. This would essentially create a new page for each google places search result after it was clicked and then whoever clicked on that same location after the page was created would be directed to the page associated with the google unique ID.

So my big question, is this possible to do with Appery.io/jQUERYm?
Thank you for your time!

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Can Appery.io dynamically create new pages from unique database Id's?

Hi Matt -

Do you want to dynamically create pages? Or you want to generate a location on the Map component dynamically of the return values from Places API?

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Can Appery.io dynamically create new pages from unique database Id's?

Thank you for your reply,

I would like to dynamically create a new pages from each google Id return value so that users can post info to that new page and it will be stored for others to see.

An example of my top response from Google places:

{
"html_attributions" : [
],
"next_page_token" : "CkQ1AAAA1y3A_h3-6cy38TqbEvAq8-4dqOMnVoDGrbsIoV4umwwa35ADOKu7KpyZ3oOj-HPF66dbNZdXu88Dx6rUMZIynRIQbRpVasDX4W1-B0RSXd33VRoUbuuUm4YrxyePu3vuBNb0X2k2feU",
"results" : [
{
"formatted_address" : "257 Royal Poinciana Way, Palm Beach, FL, United States",
"geometry" : {
"location" : {
"lat" : 26.718839,
"lng" : -80.04004999999999
}
},
"icon" : "http://maps.gstatic.com/mapfiles/plac...",

Code: Select all

     [b] "id" : "3424fb68ddadd6a0ba72b1110c6685df0cbb9786",[/b] 

      "name" : "Cucina Dell' Arte",        
      "opening_hours" : {       
         "open_now" : true 
         },     
      "photos" : [          
         {            
            "height" : 88,         
            "html_attributions" : [            
                 ],       
            "photo_reference" : "CoQBcwAAAEq61PMl6I_nouqDFdSWKUBJxF9_DHeLQdtgE76ANv3RWWnceDc3OhED41Y-IJOjSqog00r9SsoBGYi7N9CwCOYTNSnvxPFjWgIUOA_O9Gyyyo98yDzWCyyBDMeW588hhLlzDoGwV75IdVG-oTJ9TbJB6aQfih4yoy4xOFFK9qBPEhA0gcLRcwLeM-5McvonY86TGhR5Jw-l1Jeeua72RC5q0aeC2Vc36w",      
            "width" : 258 
             } 
         ],  
      "price_level" : 3, 
      "rating" : 3.9, 
      "reference" : "CoQBcgAAAHICIQd9eVqXhR8VXx9PQwyCvf81hfdwTLgHo00siGzI0u0EzUdhiS4BOaa5aUpkbSUvKQA178hwLJpa3WRa-b56yEHkBViNC0QJoD_1hs8GUPDIuVdkG9YULASVST9D8OglYSJitBzCQMSdtc8gl45rs4ezm4Jtyp0-x6onTzc8EhCRIVIGUM4IivMARF7AwG0bGhRVQPG49NqXeXbia2KPGkPX_pwIDw",     
      "types" : [ 
              "restaurant", 
              "food", 
              "establishment"  
         ] 
     }, 

Each google location response has a unique Id associated with it. I would like to save each id & location name to database and have a new page automatically generated from that response info. the new page will then always be associated with that location. Is this possible?

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Can Appery.io dynamically create new pages from unique database Id's?

I'm not sure why this is marked answered but I just wanted to make a post so it doesn't get forgotten due to the Answered label.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Can Appery.io dynamically create new pages from unique database Id's?

After further thinking on this I can most likely accomplish what I need through REST.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Can Appery.io dynamically create new pages from unique database Id's?

Hello,

Sorry for delay, Did you find the way how to do this?

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Can Appery.io dynamically create new pages from unique database Id's?

Thats ok. no, no luck yet, I'm having trouble getting the id from JSON response stored as separate entries in the DB. My grid in the UI displays search results (location name & Address) with the(google assigned) id in label Location_ID:

Search Results:

Portobello Cucina Italiana //Mapped to Place_Name Link
351 U.S. 1, Jupiter, FL, United States //Mapped to Address Label
6708ef5aecdeeaf7f804de66f66b101576b98123 // mapped to Location_ID label.

Grande's Bella Cucina
4580 Donald Ross Road, Palm Beach Gardens, FL, United States
152a263a83ba35dd22feec2f27edc04cfc704a41

etc.

This was all done by mapping.
The Id is nicely grouped with my search results and I would like to be able to click the Place_Name link and invoke a service that will store the Place_Name & Location_ID to my database.

What do you think the best way to approach this is?
Thank you for your time

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Can Appery.io dynamically create new pages from unique database Id's?

I've tried saving the response id to local storage variable an using but have not been able to retrieve the id's individually.
I tried running this to test after my search:

var resulting = JSON.stringify(localStorage.getItem('local_storage_test'));
localStorage.setItem("json_response", resulting);
var stringResulting = localStorage.getItem("json_response");
alert(stringResulting);
// this altered the last id in from the search results.

var parsedResulting = JSON.parse(localStorage.getItem('json_response'));
localStorage.setItem("json_response_parsed", parsedResulting);
var parsed_results = localStorage.getItem("json_results_parsed");
alert(json_response_parsed);
//this did nothing.

Is this the right direction to take to do what I need?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Can Appery.io dynamically create new pages from unique database Id's?

Hi Matt,

Yes, you can save such data in database and then access it. Seems to be a right direction. Let us know if you have any further questions.

Matt6607699
Posts: 0
Joined: Sat Jan 25, 2014 7:18 am

Can Appery.io dynamically create new pages from unique database Id's?

Ok thats great to know im on the right track! After I use the parse code above I can't get any results when. I alert test. Is my code wrong?

Return to “Issues”