Title: Flat JSON missing loop variable
Last modified: November 15, 2017

---

# Flat JSON missing loop variable

 *  Resolved [mattpennetti](https://wordpress.org/support/users/mattpennetti/)
 * (@mattpennetti)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/flat-json-missing-loop-variable/)
 * I have run into a problem with creating custom pages. Everything is working except
   for the creation and display of my JSON content. Here is the result I get:
 * createoptions in shortcode: JSON ok!
    start creating pages create page with JSON-
   loopkey: products no of pages to create: 0 pagetype: item must be defined in 
   plugin-settings! Great! Pagetype defined in plugin-options! Page completely loaded?
   Show created pages! ID of the creating page is 5607 delete previous generated
   pages! delete pages with that key: 5556667778 delete 0 pages of this type: item
   all 0 pages successfully deleted title template from shortcode: this is the title{{
   product_Desc}}: {{group_Desc}} create page: slugname template from shortcode:
   this is the title {{product_Desc}}: {{group_Desc}} start looping:
 * And here is my shortcode in the custom page –
 * [jsoncontentimporterpro url=http://**.**.**.**:*****/Products/1/1 parser=twig
   method=”curlget” id=3 mode=create createoptions='{“type”:”item”, “loop”:”products”,“
   title”:”this is the title {{product_Desc}}: {{group_Desc}}”, “slugname”: “{{product_Desc
   |replace({#SQM#/#SQM#: #SQM#-#SQM#})}}-{{group_Desc | lower | replace({#SQM# #
   SQM#: #SQM#-#SQM#}) }}”, “deleteold”:”yes”}’]]
 * [/jsoncontentimporterpro]
 * I think the issue is coming from my JSON. This is a small sample of it.
    There
   is no main container for all of the products. When I run it through Twig, I have
   to use the _context method to get data to display.
 * [{“id_No”:36,”product_Desc”:”BRUCE BANNER”,”group_Desc”:”FLOWERS”,”strain”:”Hybrid–
   S/I”,”quantity_On_Hand”:3.0,”unit_Measure”:”Unit”,”unit_Meas_Qty”:””,”unit_Meas_Qty_Cannabis”:
   1.0,”price_Unit”:20.0,”vend_Code”:”ATARAX”,”menu_Print”:true,”is_Active”:true,”
   menu_Image”:null,”menu_Text”:null,”menu_Website”:null,”menu_Upload”:true,”menu_Notes”:
   null},
    {“id_No”:40,”product_Desc”:”G6″,”group_Desc”:”FLOWERS”,”strain”:”Hybrid–
   S/I”,”quantity_On_Hand”:14.0,”unit_Measure”:”Unit”,”unit_Meas_Qty”:””,”unit_Meas_Qty_Cannabis”:
   1.0,”price_Unit”:20.0,”vend_Code”:”ATARAX”,”menu_Print”:true,”is_Active”:true,”
   menu_Image”:null,”menu_Text”:null,”menu_Website”:null,”menu_Upload”:true,”menu_Notes”:
   null}]
 * My thought is the last piece missing is the ‘loop’ variable. I’ve tried everything
   and scoured different sites for an answer with no luck. My JSON file is flat 
   with all items living at the top level.

Viewing 1 replies (of 1 total)

 *  Plugin Author [berkux](https://wordpress.org/support/users/berkux/)
 * (@berkux)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/flat-json-missing-loop-variable/#post-9691586)
 * Hi,
 * we moved that to the private support.
 * Bernhard

Viewing 1 replies (of 1 total)

The topic ‘Flat JSON missing loop variable’ is closed to new replies.

 * ![](https://ps.w.org/json-content-importer/assets/icon-256x256.png?rev=3464653)
 * [Get Use APIs - JSON Content Importer](https://wordpress.org/plugins/json-content-importer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/json-content-importer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/json-content-importer/)
 * [Active Topics](https://wordpress.org/support/plugin/json-content-importer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/json-content-importer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/json-content-importer/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [berkux](https://wordpress.org/support/users/berkux/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/flat-json-missing-loop-variable/#post-9691586)
 * Status: resolved