7 years ago
3
Topic

I have a file of ZIP codes that refer each number to a street name, its city and state in my country. 

Example: 20231-130 > Rua Sao Salvador / Rio de Janeiro / RJ

My question is: when a user fills out the ZIP Code field, is it possible to have Street name, City and State fields filled automatically, based on the data from this file I have?

Also, where is it best to store the data to allow that. How to insert it into SEBLOD?

Thank you!

Get a VIP membership
1283 Posts
Bucklash
7 years ago
0
Level 1

Hi

it’s probably good to import the data to your db....

Can use Seblod importer but I have no info about that...or import using sql yourself.

Once data is in db, it depends what you want to do.

If you want a user to enter a ZIP code, then save the form, and then when they view it as content, they will see they relevant info then you could either:

a: use beforestore to grab the data from db based on ZIP code ‘value’ and store in current form

or

b: have a list field which will show the data based on the zip code stored in the form

This list field will be placed in your content view.

Also, Instead of the user entering the ZIP code, perhaps have the user select the ZIP code, rather than enter it by using SELECT DYNAMIC field.

Where you store this is up to you, but if you import the data, you have to decide to store in #__some_custom_table,

or:

for each town/area/whatever create an article based on content type ie a Locations content type - That involves the importer again, of which I am completely ignorant:)

Maybe more options out there. 

6 years ago
0
Level 1

Hello Bucklash!

Thank you for your reply. 

I have successfully inserted data into the database and created a new contet type using the SEBLOD Importer.

What I need is that when a user enters the ZIP code, related fields like street name, city, state etc are filled automatically.

Best,

Helvecio

4229 Posts
Kadministrator
6 years ago
0
Level 1

You could use select dynamic cascade for that.

Get a Book for SEBLOD