We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51382
    • 53 Posts
    I am trying to import a bunch of addresses with ImportX, but my zip code TV field (tv28) is predefined field with 5 radio buttons. Is there a way to still import this field with one of the options?
      • 51382
      • 53 Posts
      Quote from: Ysanmiguel at Oct 05, 2016, 01:17 PM
      I think you need post more info about your problem, what you are asking is not easy to understand.

      In importX you can import TV values into new resources. You need to specify the TV in your header row by including the corresponding number in your Elements Tree. In this instance my TV "zip" was the 28th TV I created, hence it should be listed as tv28 in my header row of the doc I am trying to import.

      This TV however has an input type of "Radio Options" while all other fields I am importing are "text"

      When I import a csv or paste the raw data into the importX field, I need to know what format the zip code field (TV28) should be in because everything I have tried so far is leaving it blank, while all other fields are successfully populating.

      I have tried as text i.e. if the zip i want to populate is 90210, I've entered 90210 into my csv. I tried "5" since it's the fifth zip code listed as well (i.e. in my tv in the elements tree 90211 || 90212 || 90213 || 90214 || 90210).
        • 3749
        • 24,544 Posts
        I've never used ImportX, but the type of the TV shouldn't affect the value. The value goes to the 'value' field modx_site_tmplvar_contentvalues table, along with the ID of the resource (contentid) and the ID of the TV ('tmplvarid'). I'm pretty sure the value is always a string and the 'value' field should contain just the single value from the file.

        I'm not positive, but I think you should be able to change the TV to a standard Text TV, delete all files in the core/cache directory, perform the import, then change the type of the TV to meet your needs.

        Make sure that the actual ID of the TV is 28. The order of creation doesn't always match the ID. It's the ID that's used by ImportX.

        Also, make sure the file you're importing just has a single number in the field you're using for the TV's value.

          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 51382
          • 53 Posts
          Thanks guys. I'll run some tests with single records and see what the results are.