2

I have Data in JSON format, and I want to insert and update that data into Drupal. I have to update all the records which I got from an external link.

How can I achieve this?

4

In Drupal 7 you can use drupal_json_decode() which is only a one line wrapper to json_decode() anyway. If you structure your table smartly you can probably just write the output of json_decode() straight to the database (if the columns in the table agree with the data); otherwise you will have to manipulate the data a bit.

2

For the record. A beautiful way to do this is is with Feeds and Feed JSONPath Parser modules. Here is a great article: Easily import Tweets into Drupal using JSON and Feeds

Also Data module can be used to import data to custom tables.

Cheers, Duru.

1

I would give JSONData.com a try. It updates information in real time and can save you a lot of time and work. Hope that helps.

  • This looks like a really neat site! Thanks for sharing. – Chapabu Oct 21 '12 at 11:49
  • 1
    This link does not work anymore... – TheodorosPloumis Aug 19 '15 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.