Related
How can one split the below json example by different email in a for each loop? So the end result is two completely separate entities keeping there own objects and arrays.
This result comes from a sql dump but the sql connector alters the output, so I've had to parse that output in a for each loop of its own even though there is no loop it's all in one line.
[
{
"Email": "Steve#gmail.com",
"Name": "Steve Larson",
"ID": "1111",
"Date": "2022-09-12",
"Address": "10 Chicken Place",
"Town": "Gatebody",
"Postcode": "xxx 1xx",
"Data": [
{
"Ref": "34546",
"Transaction_Date": "2018-11-29",
"Amount": 27.76,
"Balance": 27.76,
"Notes": "Beep1"
},
{
"Ref": "34546v2",
"Transaction_Date": "2018-12-24",
"Amount": 27.76,
"Balance": 27.76,
"Notes": "Beep2"
}
]
},
{
"Email": "innis#gmail.com",
"Name": "Innis Blitz",
"ID": "3456",
"Date": "2022-10-12",
"Address": "33 Snake Road",
"Town": "March",
"Postcode": "cxc 3cd",
"Data": [
{
"Ref": "078776701",
"Transaction_Date": "2021-08-27",
"Amount": 984.68,
"Balance": 984.68,
"Notes": "Yes please"
},
{
"Ref": "078776701v2",
"Transaction_Date": "2021-08-27",
"Amount": 98422.6,
"Balance": 98432.6,
"Notes": "Please not now"
}
]
}
]
Would like to do a for each so it splits the above like so. The idea then for my to load the result of the for each into a template that takes arrays.
{
"Email": "Steve#gmail.com",
"Name": "Steve Larson",
"ID": "1111",
"Date": "2022-09-12",
"Address": "10 Chicken Place",
"Town": "Gatebody",
"Postcode": "xxx 1xx",
"Data": [
{
"Ref": "34546",
"Transaction_Date": "2018-11-29",
"Amount": 27.76,
"Balance": 27.76,
"Notes": "Beep1"
},
{
"Ref": "34546v2",
"Transaction_Date": "2018-12-24",
"Amount": 27.76,
"Balance": 27.76,
"Notes": "Beep2"
}
]
}
{
"Email": "innis#gmail.com",
"Name": "Innis Blitz",
"ID": "3456",
"Date": "2022-10-12",
"Address": "33 Snake Road",
"Town": "March",
"Postcode": "cxc 3cd",
"Data": [
{
"Ref": "078776701",
"Transaction_Date": "2021-08-27",
"Amount": 984.68,
"Balance": 984.68,
"Notes": "Yes please"
},
{
"Ref": "078776701v2",
"Transaction_Date": "2021-08-27",
"Amount": 98422.6,
"Balance": 98432.6,
"Notes": "Please not now"
}
]
}
I have reproduced in my environment and got expected results and I followed below process:
I have initialized your input as below:
Then i added for each control and send the output of previous step as input as inside of foreach loop, i have added send email action.
Outputs:
I have got tow jsons in two seperate emails as above.
I'm trying to fetch data from API whose response is nested json, I used collection reference to capture all the results but the results have arrays in which by default only first value is captured. I checked the documentation also (https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-schema-and-type-mapping ) and there it has mentioned only single array is supported for such operation.
Please let me know how i can capture all the nested array json values.
I tried using the Map complex values to string option also but it's not working.
Please check the image link for the json result and ADF mapping done ADF Mapping JSON Response
{
"story_count": 2325,
"next": "?page=2",
"previous": null,
"results": [
{
"id": 20111247056317,
"title": "ANZ exec bonuses cut, salaries hiked",
"summary": "[Source: AFR Online] ANZ chief executive Shayne Elliott and his executive team have had short-term bonuses cut by 50 per cent or more after profits slumped 42 per cent. However, they have almost all had sizeable increases in fixed pay that should stop them from harbouring any ill feelings towards their Melbourne-based employer. ",
"source_url": "https://global.factiva.com/en/du/article.asp?accountid=9ERN000600&accessionno=AFNROL0020201109egb9000p1",
"source_name": "Factiva",
"pub_date": "2020-11-09T06:52:18Z",
"image_url": "",
"attachments": [],
"Triggers": [
{
"id": 15174,
"name": "Cost Reduction",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 15178,
"name": "Tax Risk",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 24194,
"name": "Rewards & benefits",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Firms": [
{
"id": 17984,
"name": "AUSTRALIA AND NEW ZEALAND BANKING GROUP LIMITED",
"logo": "//112233.contify.com/client_data/custom_tag/logo/eg1lrjgo_400x400-17984.jpg"
}
],
"Duns Number": [
{
"id": 18498,
"name": "753682830",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Channels": [
{
"id": 17,
"name": "News and Other Websites",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Content Types": [
{
"id": 3,
"name": "News Articles",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Sources": [
{
"id": 68636,
"name": "Factiva",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"previews": [],
"duplicates": [],
"duplicate_count": 0
},
{
"id": 20102741904140,
"title": "HSBC to cut up to 300 jobs in UK commercial banking unit",
"summary": "[Source: FinTech Futures News] HSBC has launched a restructuring of its commercial banking business in Britain. A source familiar with the matter tells Reuters that the plan will result in around 300 job losses. The cuts are part of a wider restructuring announced in February. ",
"source_url": "https://global.factiva.com/en/du/article.asp?accountid=9ERN000600&accessionno=FTEFN00020201027egar0002w",
"source_name": "Factiva",
"pub_date": "2020-10-27T00:00:00Z",
"image_url": "",
"attachments": [],
"Triggers": [
{
"id": 15174,
"name": "Cost Reduction",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 24196,
"name": "Restructuring",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Firms": [
{
"id": 17967,
"name": "HSBC Holdings PLC",
"logo": "//112233.contify.com/client_data/custom_tag/logo/nbzwhpqp_400x400-17967.png"
},
{
"id": 35194,
"name": "HSBC Holdings",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Duns Number": [
{
"id": 18655,
"name": "288451024",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Channels": [
{
"id": 17,
"name": "News and Other Websites",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Content Types": [
{
"id": 3,
"name": "News Articles",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Sources": [
{
"id": 68636,
"name": "Factiva",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"previews": [],
"duplicates": [],
"duplicate_count": 0
},
{
"id": 20102641537340,
"title": "AT&T cuts more than 8,700 workers in third quarter amid COVID-19",
"summary": "[Source: Dallas Business Journal Online] AT&T is making some deeper cuts with its employee base. The Dallas telecommunications and media company shrunk the number of employees by 8,720 in the third quarter to less than 235,000, according to information on its investor relations website. ",
"source_url": "https://global.factiva.com/en/du/article.asp?accountid=9ERN000600&accessionno=DALBJO0020201026egap00001",
"source_name": "Factiva",
"pub_date": "2020-10-25T00:00:00Z",
"image_url": "",
"attachments": [],
"Triggers": [
{
"id": 15174,
"name": "Cost Reduction",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 23058,
"name": "Covid-19",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Firms": [
{
"id": 17963,
"name": "AT&T Inc.",
"logo": "//112233.contify.com/client_data/custom_tag/logo/a7jsrall_400x400-17963.png"
}
],
"Duns Number": [
{
"id": 18497,
"name": "108024050",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Channels": [
{
"id": 17,
"name": "News and Other Websites",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Content Types": [
{
"id": 3,
"name": "News Articles",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Sources": [
{
"id": 68636,
"name": "Factiva",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"previews": [],
"duplicates": [
{
"id": 20102641627014,
"title": "AT&T cuts more than 8,700 workers in third quarter amid Covid-19",
"summary": "[Source: Louisville Business First Online] AT&T is making some deeper cuts with its employee base. The Dallas telecommunications and media company shrunk the number of employees by 8,720 in the third quarter to less than 235,000, according to information on its investor relations website. ",
"source_url": "https://global.factiva.com/en/du/article.asp?accountid=9ERN000600&accessionno=BSFLVO0020201026egaq00001",
"source_name": "Factiva"
},
{
"id": 20102741677548,
"title": "AT&T cuts more than 8,700 workers in third quarter amid Covid-19",
"summary": "[Source: Orlando Business Journal] AT&T is making some deeper cuts with its employee base. The Dallas-based telecommunications and media company (NYSE: T) shrunk the number of its employees by 8,720 in the third quarter to less than 235,000, according to information on its investor relations website. ",
"source_url": "https://global.factiva.com/en/du/article.asp?accountid=9ERN000600&accessionno=ORBJ000020201026egaq0005m",
"source_name": "Factiva"
}
],
"duplicate_count": 2
},
{
"id": 20102641660233,
"title": "Lufthansa considers cutting 30,000 jobs due to fall in air traffic",
"summary": "[Source: French Collection] German airline Lufthansa is facing a fall in air traffic due to the Covid-19 pandemic and consequently up to 30,000 jobs are threatened, its management said. Lufthansa is determined to keep at least 100,000 of the 130,000 positions in total at the group, Carsten Spohr, CEO of the airline, explained. ",
"source_url": "https://global.factiva.com/en/du/article.asp?accountid=9ERN000600&accessionno=FRECOL0020201026egaq000jh",
"source_name": "Factiva",
"pub_date": "2020-10-26T00:00:00Z",
"image_url": "",
"attachments": [],
"Triggers": [
{
"id": 15174,
"name": "Cost Reduction",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Firms": [
{
"id": 18140,
"name": "Deutsche Lufthansa AG",
"logo": "//112233.contify.com/client_data/custom_tag/logo/-99kuzpm_400x400-18140.jpg"
},
{
"id": 35588,
"name": "Lufthansa Group",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Duns Number": [
{
"id": 18584,
"name": "315000893",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Channels": [
{
"id": 17,
"name": "News and Other Websites",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Content Types": [
{
"id": 3,
"name": "News Articles",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Sources": [
{
"id": 68636,
"name": "Factiva",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"previews": [],
"duplicates": [],
"duplicate_count": 0
},
{
"id": 20102541378844,
"title": "ExxonMobil chief warns US, Canada jobs cuts coming soon",
"summary": "[Source: Agence France Presse] Global oil giant ExxonMobil will release details soon of expected job cuts in the United States and Canada, the company's chief Darren Woods said in a letter to employees. \"As difficult as this is, I hope you understand it is critically important for the future of our company,\" Woods said in a statement Wednesday. ",
"source_url": "https://global.factiva.com/en/du/article.asp?accountid=9ERN000600&accessionno=AFPR000020201022egam00dqh",
"source_name": "Factiva",
"pub_date": "2020-10-22T13:04:58Z",
"image_url": "",
"attachments": [],
"Triggers": [
{
"id": 15174,
"name": "Cost Reduction",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 15178,
"name": "Tax Risk",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Firms": [
{
"id": 24236,
"name": "Exxon Mobil Corporation",
"logo": "//112233.contify.com/client_data/custom_tag/logo/ytocyynn_400x400-24236.jpg"
}
],
"Duns Number": [
{
"id": 24342,
"name": "1213214",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 34007,
"name": "001213214",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Channels": [
{
"id": 17,
"name": "News and Other Websites",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Content Types": [
{
"id": 3,
"name": "News Articles",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Sources": [
{
"id": 68636,
"name": "Factiva",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"previews": [],
"duplicates": [],
"duplicate_count": 0
},
{
"id": 20102541377022,
"title": "Cathay Pacific to lay off 5,900 employees, close low-cost subsidiary",
"summary": "[Source: Kazinform International News Agency] HONG. KONG. KAZINFORM Hong Kong s flag carrier Cathay Pacific announced Wednesday it would lay off 5,900 employees and close low-cost subsidiary Cathay Dragon following corporate restructuring in response to the coronavirus s effect on aviation.«The restructuring will enable the company to secure its future, so it can protect as many jobs as possible, whilst meeting its responsibilities to the Hong Kong aviation hub and its customers,» the carrier said in a statement, EFE-EPA reports. ",
"source_url": "https://global.factiva.com/en/du/article.asp?accountid=9ERN000600&accessionno=KAZNAE0020201021egal000b7",
"source_name": "Factiva",
"pub_date": "2020-10-21T12:13:00Z",
"image_url": "",
"attachments": [],
"Triggers": [
{
"id": 15174,
"name": "Cost Reduction",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 15178,
"name": "Tax Risk",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 23058,
"name": "Covid-19",
"logo": "//112233.contify.com/images/tags-ico.png"
},
{
"id": 24196,
"name": "Restructuring",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Firms": [
{
"id": 35127,
"name": "Cathay Pacific Airways Ltd.",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Duns Number": [
{
"id": 33981,
"name": "686093188",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Channels": [
{
"id": 17,
"name": "News and Other Websites",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Content Types": [
{
"id": 3,
"name": "News Articles",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"Sources": [
{
"id": 68636,
"name": "Factiva",
"logo": "//112233.contify.com/images/tags-ico.png"
}
],
"previews": [],
"duplicates": [],
"duplicate_count": 0
}
]
}
I would recommend you consider calling a Stored Procedure activity instead of a copy activity. Then parse and store the JSON inside the stored procedure. I have written up this approach in the following answer. You can ignore the For loop if it’s a single REST API call. I’m working under the assumption that your destination database is SQL Server or Azure SQL Database, but correct me if that’s incorrect.
Here is the full json that I want to parse and extract the text that has the value: The product is in second line 3rd row.
Can someone help?
"activities": [
{
"type": "message",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2019-07-01T15:18:56.8251462Z",
"serviceUrl": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"channelId": "directline",
"from": {
"id": "user1"
},
"conversation": {
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
},
"text": "the milk"
},
{
"type": "message",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2019-07-01T15:18:57.6856172Z",
"localTimestamp": "2019-07-01T15:18:57.5099359+00:00",
"channelId": "directline",
"from": {
"id": "XXXXXX",
"name": "XXXXXX"
},
"conversation": {
"id": "XXXXXXXXXXXXXXXXXX"
},
"text": "The product is in second line 3rd row",
"attachments": [],
"entities": [],
"replyToId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
],
"watermark": "1"
}
You have specified that this is a full json you have placed in the question, But it is not full json you are missing something.
"activities":
[ //json array start from here
{
"type": "message",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2019-07-01T15:18:56.8251462Z",
"serviceUrl": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"channelId": "directline",
"from": {
"id": "user1"
},
"conversation": {
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
},
"text": "the milk"
},
{
"type": "message",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2019-07-01T15:18:57.6856172Z",
"localTimestamp": "2019-07-01T15:18:57.5099359+00:00",
"channelId": "directline",
"from": {
"id": "XXXXXX",
"name": "XXXXXX"
},
"conversation": {
"id": "XXXXXXXXXXXXXXXXXX"
},
"text": "The product is in second line 3rd row",
"attachments": [],
"entities": [],
"replyToId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
], //json array ends here
these are extra lines
***"watermark": "1"
}***
if you want to use this array you need to add a '{' in very top line before
"activities": [
I am placing here a valid json now you can check it on Json parser used to parse json in objects
*Valid Json Here : *
{
"activities": [
{
"type": "message",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2019-07-01T15:18:56.8251462Z",
"serviceUrl": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"channelId": "directline",
"from": {
"id": "user1"
},
"conversation": {
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
},
"text": "the milk"
},
{
"type": "message",
"id": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2019-07-01T15:18:57.6856172Z",
"localTimestamp": "2019-07-01T15:18:57.5099359+00:00",
"channelId": "directline",
"from": {
"id": "XXXXXX",
"name": "XXXXXX"
},
"conversation": {
"id": "XXXXXXXXXXXXXXXXXX"
},
"text": "The product is in second line 3rd row",
"attachments": [],
"entities": [],
"replyToId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
],
"watermark": "1"
}
I am new to getting JSON into SQL Server 2016, I thought I had it down, but I notice that I am missing some details from the array, looking at the image, there are four address', but I saw there are some more address' missing for example Burrows Rd, and Urana RD. How can I make sure that all the address' captured?
https://i.stack.imgur.com/erzBV.jpg
#json nvarchar(max)
#json = N'{
"response": [
{
"application": {
"info": {
"dat_id": "010.2018.00036494.001",
"development_type": "Residential - Single new dwelling",
"application_type": "DA",
"last_modified_date": "2018-12-03T11:35:24+11:00",
"description": "Residence, Garage & Colorbond Shed, Demolition of Existing Residence & Tree Removal",
"authority": {
"ref": "http://gemini:82/ApplicationTracker/atdis/1.0",
"name": "AlburyCity"
},
"lodgement_date": "2018-10-26T00:00:00+11:00",
"determination_date": null,
"determination_type": "Pending",
"status": "In Progress",
"notification_start_date": null,
"notification_end_date": null,
"officer": "David Flood",
"estimated_cost": "Not applicable.",
"related_apps": [ ]
},
"reference": {
"more_info_url": "http://gemini:82/ApplicationTracker/Application/ApplicationDetails/010.2018.00036494.001/",
"comments_url": null
},
"locations": [
{
"land_title_ref": {
"torrens": {
"lot": "11",
"section": null,
"dpsp_id": "DP 1031272"
}
},
"address": {
"street": "680 Centaur RD",
"suburb": "HAMILTON VALLEY",
"state": "NSW",
"postcode": "2641"
},
"geometry": null
},
{
"land_title_ref": {
"torrens": {
"lot": "11",
"section": null,
"dpsp_id": "DP 1031272"
}
},
"address": {
"street": "Urana RD",
"suburb": "HAMILTON VALLEY",
"state": "NSW",
"postcode": "2641"
},
"geometry": null
},
{
"land_title_ref": {
"torrens": {
"lot": "11",
"section": null,
"dpsp_id": "DP 1031272"
}
},
"address": {
"street": "Burrows RD",
"suburb": "HAMILTON VALLEY",
"state": "NSW",
"postcode": "2641"
},
"geometry": null
}
],
"events": [
{
"id": "3680347",
"timestamp": "2018-11-01T15:58:00+11:00",
"description": "Public Notification",
"event_type": "PNOT",
"status": "COMP"
},
{
"id": "3680348",
"timestamp": "2018-11-01T15:58:00+11:00",
"description": "Referral Engineering",
"event_type": "ENG",
"status": "COMP"
},
{
"id": "3680349",
"timestamp": "2018-11-01T15:59:00+11:00",
"description": "Referal Parks & Recreation",
"event_type": "TREE",
"status": "COMP"
},
{
"id": "3680350",
"timestamp": "2018-11-01T16:00:00+11:00",
"description": "Acknowledgement to Applicant",
"event_type": "ACKN",
"status": "COMP"
},
{
"id": "3683617",
"timestamp": "2018-11-21T14:59:00+11:00",
"description": "Site Assessment Inspection",
"event_type": "SITE",
"status": "PASS"
},
{
"id": "3685155",
"timestamp": "2018-12-03T11:37:00+11:00",
"description": "Assessment Report",
"event_type": "ASS3",
"status": "COMP"
}
],
"documents": [
{
"ref": "DOC18/163129",
"title": "Statement of Environmental Effects - SEE",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=6hF7YEiv0qE=&fileName=Statement+of+Environmental+Effects+-+SEE.PDF"
},
{
"ref": "DOC18/163139",
"title": "Site Plan and Elevations",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=1Gv3GVOIHCM=&fileName=Site+Plan+and+Elevations.PDF"
}
],
"people": [
{
"name": "Karyn Ford",
"role": "Applicant",
"contact": "6023 8287"
}
],
"extended": {
"software_vendor": "Civica",
"software_vendor_url": "http://www.civica.com.au"
}
}
},
{
"application": {
"info": {
"dat_id": "017.2018.00036017.001",
"development_type": "Subdivision Only",
"application_type": "SCC",
"last_modified_date": "2018-12-03T10:19:25+11:00",
"description": "Roads, Sewer, Water & Drainage for Two (2) Lot Torrens Title Subdivisi on",
"authority": {
"ref": "http://gemini:82/ApplicationTracker/atdis/1.0",
"name": "AlburyCity"
},
"lodgement_date": "2018-11-14T00:00:00+11:00",
"determination_date": "2018-11-29T00:00:00+11:00",
"determination_type": "Approved under delegation",
"status": "Determined",
"notification_start_date": null,
"notification_end_date": null,
"officer": "Sharna Holland",
"estimated_cost": "Not applicable.",
"related_apps": [ "http://gemini:82/ApplicationTracker/atdis/1.0/010.2018.00036017.001.json" ]
},
"reference": {
"more_info_url": "http://gemini:82/ApplicationTracker/Application/ApplicationDetails/017.2018.00036017.001/",
"comments_url": null
},
"locations": [
{
"land_title_ref": {
"torrens": {
"lot": "A",
"section": null,
"dpsp_id": "DP 161410"
}
},
"address": {
"street": "419 Hovell ST",
"suburb": "SOUTH ALBURY",
"state": "NSW",
"postcode": "2640"
},
"geometry": null
},
{
"land_title_ref": {
"torrens": {
"lot": "A",
"section": null,
"dpsp_id": "DP 161410"
}
},
"address": {
"street": "Charles ST",
"suburb": "SOUTH ALBURY",
"state": "NSW",
"postcode": "2640"
},
"geometry": null
}
],
"events": [
{
"id": "3683888",
"timestamp": "2018-11-23T14:03:00+11:00",
"description": "Acknowledgement to Applicant",
"event_type": "ACKN",
"status": "COMP"
},
{
"id": "3683902",
"timestamp": "2018-11-23T15:21:00+11:00",
"description": "Referral Engineering",
"event_type": "ENG",
"status": "COMP"
},
{
"id": "3683903",
"timestamp": "2018-11-23T15:21:00+11:00",
"description": "Referral Building Surveyor 3",
"event_type": "BS3",
"status": "COMP"
},
{
"id": "3683904",
"timestamp": "2018-11-23T15:21:00+11:00",
"description": "Referral Trainee Town Planner",
"event_type": "TTP1",
"status": "COMP"
},
{
"id": "3684791",
"timestamp": "2018-11-29T14:36:00+11:00",
"description": "Collected Determination",
"event_type": "COLL",
"status": "COMP"
}
],
"documents": [
{
"ref": "DOC18/177392",
"title": "Subdivision Works Certificate",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=8qU1Pkawfvg=&fileName=Subdivision+Works+Certificate.PDF"
}
],
"people": [
{
"name": "Eslers Land Consulting",
"role": "Applicant",
"contact": "6021 1322"
}
],
"extended": {
"software_vendor": "Civica",
"software_vendor_url": "http://www.civica.com.au"
}
}
},
{
"application": {
"info": {
"dat_id": "010.2016.00034838.001",
"development_type": "Residential - New multi unit",
"application_type": "DA",
"last_modified_date": "2018-12-03T09:36:09+11:00",
"description": "Twenty (20) Detached Self Contained Residences - Kensington Gardens Retirement Village",
"authority": {
"ref": "http://gemini:82/ApplicationTracker/atdis/1.0",
"name": "AlburyCity"
},
"lodgement_date": "2016-08-17T00:00:00+10:00",
"determination_date": "2016-10-24T00:00:00+11:00",
"determination_type": "Approved under delegation",
"status": "Determined",
"notification_start_date": null,
"notification_end_date": null,
"officer": "Christopher Eldred",
"estimated_cost": "Not applicable.",
"related_apps": [ "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.001.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.002.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.003.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.004.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.005.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.006.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.007.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.008.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.009.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.010.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.011.json", "http://gemini:82/ApplicationTracker/atdis/1.0/011.2016.00034838.012.json" ]
},
"reference": {
"more_info_url": "http://gemini:82/ApplicationTracker/Application/ApplicationDetails/010.2016.00034838.001/",
"comments_url": null
},
"locations": [
{
"land_title_ref": {
"torrens": {
"lot": "2",
"section": null,
"dpsp_id": "DP 874732"
}
},
"address": {
"street": "100 Table Top RD",
"suburb": "THURGOONA",
"state": "NSW",
"postcode": "2640"
},
"geometry": null
}
],
"events": [
{
"id": "3583145",
"timestamp": "2016-08-17T14:13:00+10:00",
"description": "Further Information Requested",
"event_type": "INFO",
"status": "COMP"
},
{
"id": "3573096",
"timestamp": "2016-08-18T15:34:00+10:00",
"description": "Public Notification",
"event_type": "PNOT",
"status": "COMP"
},
{
"id": "3573097",
"timestamp": "2016-08-18T15:37:00+10:00",
"description": "Referral Building Surveyor 2",
"event_type": "BS2",
"status": "COMP"
},
{
"id": "3573098",
"timestamp": "2016-08-18T15:37:00+10:00",
"description": "Referral Plumbing Inspector",
"event_type": "PI",
"status": "COMP"
},
{
"id": "3573099",
"timestamp": "2016-08-18T15:37:00+10:00",
"description": "Referral Engineering",
"event_type": "ENG",
"status": "COMP"
},
{
"id": "3573100",
"timestamp": "2016-08-18T15:38:00+10:00",
"description": "Referral Environmental Planner",
"event_type": "ENV",
"status": "COMP"
},
{
"id": "3573103",
"timestamp": "2016-08-18T15:43:43+10:00",
"description": "Acknowledgement to Applicant",
"event_type": "ACKN",
"status": "COMP"
},
{
"id": "3575194",
"timestamp": "2016-09-06T00:00:00+10:00",
"description": "Assessment Report",
"event_type": "ASS3",
"status": "COMP"
}
],
"documents": [
{
"ref": "DOC16/209893",
"title": "Statement of Environmental Effects - SEE",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=sQkVV9rEsTU=&fileName=Statement+of+Environmental+Effects+-+SEE.PDF"
},
{
"ref": "DOC16/209896",
"title": "Site Plan & Elevations",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=3dRqEZHzGeo=&fileName=Site+Plan+%26+Elevations.PDF"
},
{
"ref": "DOC16/211819",
"title": "Assessment Report",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=DVTQkQQqbns=&fileName=Assessment+Report.PDF"
},
{
"ref": "DOC16/240764",
"title": "Development Consent",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=TY+Y3zjyDKw=&fileName=Development+Consent.PDF"
}
],
"people": [
{
"name": "Kensington Gardens Lifestyle Estates",
"role": "Applicant",
"contact": "6049 3100"
}
],
"extended": {
"software_vendor": "Civica",
"software_vendor_url": "http://www.civica.com.au"
}
}
},
{
"application": {
"info": {
"dat_id": "010.2018.00036468.001",
"development_type": "Residential - Single new dwelling",
"application_type": "DA",
"last_modified_date": "2018-11-30T17:17:25+11:00",
"description": "Residence, Garage and Retaining Walls",
"authority": {
"ref": "http://gemini:82/ApplicationTracker/atdis/1.0",
"name": "AlburyCity"
},
"lodgement_date": "2018-10-19T00:00:00+11:00",
"determination_date": "2018-11-26T00:00:00+11:00",
"determination_type": "Approved under delegation",
"status": "Determined",
"notification_start_date": null,
"notification_end_date": null,
"officer": "David Flood",
"estimated_cost": "Not applicable.",
"related_apps": [ "http://gemini:82/ApplicationTracker/atdis/1.0/011.2018.00036468.001.json" ]
},
"reference": {
"more_info_url": "http://gemini:82/ApplicationTracker/Application/ApplicationDetails/010.2018.00036468.001/",
"comments_url": null
},
"locations": [
{
"land_title_ref": {
"torrens": {
"lot": "218",
"section": null,
"dpsp_id": "DP 1228226"
}
},
"address": {
"street": "20 Stockman CRCT",
"suburb": "THURGOONA",
"state": "NSW",
"postcode": "2640"
},
"geometry": null
}
],
"events": [
{
"id": "3678966",
"timestamp": "2018-10-25T10:47:00+11:00",
"description": "Public Notification",
"event_type": "PNOT",
"status": "COMP"
},
{
"id": "3678967",
"timestamp": "2018-10-25T10:48:00+11:00",
"description": "Referral Engineering",
"event_type": "ENG",
"status": "COMP"
},
{
"id": "3678974",
"timestamp": "2018-10-25T10:51:00+11:00",
"description": "Acknowledgement to Applicant",
"event_type": "ACKN",
"status": "COMP"
},
{
"id": "3681955",
"timestamp": "2018-11-01T15:49:00+11:00",
"description": "Site Assessment Inspection",
"event_type": "SITE",
"status": "COMP"
},
{
"id": "3684251",
"timestamp": "2018-11-27T10:24:00+11:00",
"description": "Collected Determination",
"event_type": "COLL",
"status": "COMP"
}
],
"documents": [
{
"ref": "DOC18/159026",
"title": "Statement of Environmental Effects - SEE",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=MaiWkTs8V+g=&fileName=Statement+of+Environmental+Effects+-+SEE.PDF"
},
{
"ref": "DOC18/159033",
"title": "Site Plan and Elevations and Superseded Plan",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=2xpqra8gNb0=&fileName=Site+Plan+and+Elevations+and+Superseded+Plan.PDF"
},
{
"ref": "DOC18/162569",
"title": "Assessment Report - Bldg Residential",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=bKYCMP01aJE=&fileName=Assessment+Report+-+Bldg+Residential.PDF"
},
{
"ref": "DOC18/168584",
"title": "Development Consent",
"document_url": "http://gemini:82/ApplicationTracker/atdis/1.0/Document/Download?key=SxGG/yKi68s=&fileName=Development+Consent.PDF"
}
],
"people": [
{
"name": "Alatalo Bros",
"role": "Applicant",
"contact": "02 6055 0180"
}
],
"extended": {
"software_vendor": "Civica",
"software_vendor_url": "http://www.civica.com.au"
}
}
}
],
"count": 4,
"pagination": {
"previous": null,
"next": 2,
"current": 1,
"per_page": 4,
"count": 24091,
"pages": 6023
}
}'
select *
from OPENJSON(#json, '$.response')
with
([lot] varchar(200) '$.application.locations[0].land_title_ref.torrens.lot',
[section] varchar(200) '$.application.locations[0].land_title_ref.torrens.section',
[dpsp_id] varchar(200) '$.application.locations[0].land_title_ref.torrens.dpsp_id',
[Street] varchar(200) '$.application.locations[0].address.street',
[suburb] varchar(200) '$.application.locations[0].address.suburb',
[state] varchar(200) '$.application.locations[0].address.state',
[postcode] varchar(200) '$.application.locations[0].address.postcode',
[geometry] varchar(200) '$.application.locations[0].geometry'
)
Try this:
select L.*
from OPENJSON(#json,'$.response') R
CROSS APPLY OPENJSON(R.[value], '$.application.locations')
with
(
[lot] varchar(200) '$.land_title_ref.torrens.lot',
[section] varchar(200) '$.land_title_ref.torrens.section',
[dpsp_id] varchar(200) '$.land_title_ref.torrens.dpsp_id',
[Street] varchar(200) '$.address.street',
[suburb] varchar(200) '$.address.suburb',
[state] varchar(200) '$.address.state',
[postcode] varchar(200) '$.address.postcode',
[geometry] varchar(200) '$.geometry'
) L
The locations is an array, so we need to use cross apply and OPENSJON to get all elements.
The error i am getting is this : Can't parse fields attribute. Is it a JSON array or CSV list?
The problem is in the select menu which is being included in the form. what i want to achieve is a select box as shown here on this link : Registration plugin
But somehow the problem is that the select box is not being displayed!
<iframe src='http://www.facebook.com/plugins/registration.php?
client_id=325340244194060&
redirect_uri=http://www.pingcampus.com/facebook_registration_plugin/store_user_data.php&
fields=[
{"name":"name"},
{"name":"email"},
{"name":"gender"},
{"name":"birthday"},
{'name':'captain', 'description':'Best Captain', 'type':'select', 'options':{'P':'Jean-Luc Picard','K':'James T. Kirk'}}
{'name':'captain', 'description':'College','type':'select','options':
{'P':'Jean-Luc Picard','K':'James T. Kirk',
'1':'Acropolis','2':'Astral','3':'Aurobindo','4':'BM','5':'Central','6':'Chameli','7':'IET (DAVV)','8':'IIST
','9':'IIST2
','10':'IPS
','11':'JDCT
','12':'KCB
','13':'LKCT
','14':'LNCT
','15':'MIT (Malwa)
','16':'Malwa (Malwa2)
','17':'Mandsaur
','18':'Mathuradevi
','19':'MITM (Medi1)
','20':'MIST (Medi2)
','21':'MGIEM
','22':'Nalin
','23':'Oriental
','24':'Patel
','25':'Prestige
','26':'Priyatam
','27':'Rishiraj
','28':'RKDF
','29':'Royal
','30':'Sanghvi
','31':'Sdbansal
','32':'SGSITS
','33':'SIMS
','34':'SKSITS
','35':'Star
','36':'SVCE
','37':'SVITS
','38':'Transnational
','39':'Truba
','40':'Venkateshwar
','41':'Vidhyasagar
','42':'Vikrant
','43':'Vindhya
','#':'--------------------------------
','#':'Commerce
','#':'--------------------------------
','44':'Acro
','45':'Apex
','46':'Arihant
','47':'BM
','48':'Chamelidevi
','49':'Chimc
','50':'Choithram
','51':'Christian
','52':'DCBS (Daly College)
','53':'IBMR
','54':'IIMR (IIST)
','55':'IIPS (DAVV)
','56':'Ilva
','57':'IMIR
','58':'Imperial
','59':'IMS (DAVV)
','60':'Islamia
','61':'JDCT
','62':'LKCT
','63':'LNCT
','64':'Maharaja
','65':'MIT (Malwa)
','66':'Mathuradevi
','67':'Matushri
','68':'MBKhalsa
','69':'Medicaps
','70':'Patel
','71':'Pioneer
','72':'Prestige
','73':'Priyatam
','74':'Renaissance
','75':'Rishiraj
','76':'Sahib
','77':'SAIMS
','78':'Sanghvi Innovative
','79':'Sapient
','80':'SGSITS
','81':'SIMS
','82':'SJDM
','83':'SKSITS
','84':'Softvision
','85':'SVCE
','86':'Rransnational
','87':'Vaishnav
','88':'Venkteshwar
','89':'Vidhyasagar
','90':'Vikrant
','#':'--------------------------------
','#':'Pharmacy
','#':'--------------------------------
','91':'Acropolis
','92':'Aurobindo
','93':'BM
','94':'Central
','95':'SOPE (DAVV)
','96':'IIP(IIST)
','97':'IPS
','98':'Oriental
','99':'Rishiraj
','100':'RKDF
','101':'Safe
','102':'SGSITS
','103':'Smriti (SCOPE)
','104':'svce
','105':'vikrant
','#':'--------------------------------
','#':'Medical
','#':'--------------------------------
','106':'Arihant
','107':'Bombay Hospital
','108':'Index
','109':'MGMMC
','110':'RD Memorial
','111':'Shubhdeep
','#':'--------------------------------
','#':'Dental
','#':'--------------------------------
','112':'Aurobindo
','113':'CDSH
','114':'GCD
','115':'Index
','116':'Modern
','#':'--------------------------------
','#':'Arts
','#':'--------------------------------
','117':'BIG Aims
','118':'Frameboxx
','119':'INIFD
','120':'MAAC
','121':'SDPS
','122':'SJMC (DAVV)
','123':'Virtual Voyage
','124':'Zica
','132':'EMRC (DAVV)
','#':'--------------------------------
','#':'Architecture
','#':'--------------------------------
','125':'IPS
','126':'SDPS
','#':'--------------------------------
','#':'Law
','#':'--------------------------------
','127':'Christian
','128':'SOL(DAVV)
','129':'IIL
','130':'Vaishnav'} },
{"name":"Arts","description":"Arts","type":"checkbox","value":"Arts"},
{"name":"Act","description":"Act","type":"checkbox","value":"Act"},
{"name":"Cooking","description":"Cooking","type":"checkbox","value":"Cooking"},
{"name":"Dance","description":"Dance","type":"checkbox","value":"Dance"},
{"name":"Designing","description":"Designing","type":"checkbox","value":"Designing"},
{"name":"Fashion","description":"Fashion Designing","type":"checkbox","value":"Fashion Designing"},
{"name":"Interior","description":"Interior Designing","type":"checkbox","value":"Interior Designing"},
{"name":"Modeling","description":"Modeling","type":"checkbox","value":"Modeling"},
{"name":"Photography","description":"Photography","type":"checkbox","value":"Photography"},
{"name":"Poetry","description":"Poetry / Writing","type":"checkbox","value":"Poetry / Writing"},
{"name":"Programming","description":"Programming","type":"checkbox","value":"Programming"},
{"name":"Reading","description":"Reading","type":"checkbox","value":"Reading"},
{"name":"Sketching","description":"Sketching / Drawing","type":"checkbox","value":"Sketching / Drawing"},
{"name":"Singing","description":"Singing","type":"checkbox","value":"Singing"},
{"name":"Sports","description":"Sports","type":"checkbox","value":"Sports"},
{"name":"Stunting","description":"Stunting","type":"checkbox","value":"Stunting"},
{"name":"Videography","description":"Checkthis","type":"checkbox","value":"Videography"},
{"name":"Other","description":"Other","type":"checkbox","value":"Other"},
{"name":"captcha"}
]'
scrolling="auto"
frameborder="no"
style="border:none"
allowTransparency="true"
width="500"
height="800"
>
</iframe>
Try to replace fields=[....] with valid JSON
[
{
"name": "name"
},
{
"name": "email"
},
{
"name": "gender"
},
{
"name": "birthday"
},
{
"name": "captain",
"description": "BestCaptain",
"type": "select",
"options": {
"P": "Jean-LucPicard",
"K": "JamesT.Kirk"
}
},
{
"name": "captain",
"description": "College",
"type": "select",
"options": {
"1": "Acropolis",
"2": "Astral",
"3": "Aurobindo",
"4": "BM",
"5": "Central",
"6": "Chameli",
"7": "IET(DAVV)",
"8": "IIST",
"9": "IIST2",
"10": "IPS",
"11": "JDCT",
"12": "KCB",
"13": "LKCT",
"14": "LNCT",
"15": "MIT(Malwa)",
"16": "Malwa(Malwa2)",
"17": "Mandsaur",
"18": "Mathuradevi",
"19": "MITM(Medi1)",
"20": "MIST(Medi2)",
"21": "MGIEM",
"22": "Nalin",
"23": "Oriental",
"24": "Patel",
"25": "Prestige",
"26": "Priyatam",
"27": "Rishiraj",
"28": "RKDF",
"29": "Royal",
"30": "Sanghvi",
"31": "Sdbansal",
"32": "SGSITS",
"33": "SIMS",
"34": "SKSITS",
"35": "Star",
"36": "SVCE",
"37": "SVITS",
"38": "Transnational",
"39": "Truba",
"40": "Venkateshwar",
"41": "Vidhyasagar",
"42": "Vikrant",
"43": "Vindhya",
"44": "Acro",
"45": "Apex",
"46": "Arihant",
"47": "BM",
"48": "Chamelidevi",
"49": "Chimc",
"50": "Choithram",
"51": "Christian",
"52": "DCBS(DalyCollege)",
"53": "IBMR",
"54": "IIMR(IIST)",
"55": "IIPS(DAVV)",
"56": "Ilva",
"57": "IMIR",
"58": "Imperial",
"59": "IMS(DAVV)",
"60": "Islamia",
"61": "JDCT",
"62": "LKCT",
"63": "LNCT",
"64": "Maharaja",
"65": "MIT(Malwa)",
"66": "Mathuradevi",
"67": "Matushri",
"68": "MBKhalsa",
"69": "Medicaps",
"70": "Patel",
"71": "Pioneer",
"72": "Prestige",
"73": "Priyatam",
"74": "Renaissance",
"75": "Rishiraj",
"76": "Sahib",
"77": "SAIMS",
"78": "SanghviInnovative",
"79": "Sapient",
"80": "SGSITS",
"81": "SIMS",
"82": "SJDM",
"83": "SKSITS",
"84": "Softvision",
"85": "SVCE",
"86": "Rransnational",
"87": "Vaishnav",
"88": "Venkteshwar",
"89": "Vidhyasagar",
"90": "Vikrant",
"91": "Acropolis",
"92": "Aurobindo",
"93": "BM",
"94": "Central",
"95": "SOPE(DAVV)",
"96": "IIP(IIST)",
"97": "IPS",
"98": "Oriental",
"99": "Rishiraj",
"100": "RKDF",
"101": "Safe",
"102": "SGSITS",
"103": "Smriti(SCOPE)",
"104": "svce",
"105": "vikrant",
"106": "Arihant",
"107": "BombayHospital",
"108": "Index",
"109": "MGMMC",
"110": "RDMemorial",
"111": "Shubhdeep",
"112": "Aurobindo",
"113": "CDSH",
"114": "GCD",
"115": "Index",
"116": "Modern",
"117": "BIGAims",
"118": "Frameboxx",
"119": "INIFD",
"120": "MAAC",
"121": "SDPS",
"122": "SJMC(DAVV)",
"123": "VirtualVoyage",
"124": "Zica",
"125": "IPS",
"126": "SDPS",
"127": "Christian",
"128": "SOL(DAVV)",
"129": "IIL",
"130": "Vaishnav",
"132": "EMRC(DAVV)",
"P": "Jean-LucPicard",
"K": "JamesT.Kirk",
"#": "--------------------------------"
}
},
{
"name": "Arts",
"description": "Arts",
"type": "checkbox",
"value": "Arts"
},
{
"name": "Act",
"description": "Act",
"type": "checkbox",
"value": "Act"
},
{
"name": "Cooking",
"description": "Cooking",
"type": "checkbox",
"value": "Cooking"
},
{
"name": "Dance",
"description": "Dance",
"type": "checkbox",
"value": "Dance"
},
{
"name": "Designing",
"description": "Designing",
"type": "checkbox",
"value": "Designing"
},
{
"name": "Fashion",
"description": "Fashion Designing",
"type": "checkbox",
"value": "Fashion Designing"
},
{
"name": "Interior",
"description": "Interior Designing",
"type": "checkbox",
"value": "Interior Designing"
},
{
"name": "Modeling",
"description": "Modeling",
"type": "checkbox",
"value": "Modeling"
},
{
"name": "Photography",
"description": "Photography",
"type": "checkbox",
"value": "Photography"
},
{
"name": "Poetry",
"description": "Poetry / Writing",
"type": "checkbox",
"value": "Poetry / Writing"
},
{
"name": "Programming",
"description": "Programming",
"type": "checkbox",
"value": "Programming"
},
{
"name": "Reading",
"description": "Reading",
"type": "checkbox",
"value": "Reading"
},
{
"name": "Sketching",
"description": "Sketching / Drawing",
"type": "checkbox",
"value": "Sketching / Drawing"
},
{
"name": "Singing",
"description": "Singing",
"type": "checkbox",
"value": "Singing"
},
{
"name": "Sports",
"description": "Sports",
"type": "checkbox",
"value": "Sports"
},
{
"name": "Stunting",
"description": "Stunting",
"type": "checkbox",
"value": "Stunting"
},
{
"name": "Videography",
"description": "Checkthis",
"type": "checkbox",
"value": "Videography"
},
{
"name": "Other",
"description": "Other",
"type": "checkbox",
"value": "Other"
},
{
"name": "captcha"
}
]
Your fields parameter for Registration social plugin contain not valid JSON object (JSON should use double quotes instead of single quotes) and you're missing , (comma) in the middle of array, after next line:
{'name':'captain', 'description':'Best Captain', 'type':'select', 'options':{'P':'Jean-Luc Picard','K':'James T. Kirk'}}
Update:
Actually even usage of just valid JSON may not work in that case due to fact that this is passed as query string arguments, so that JSON should be properly encoded to avoid problems. Also may cause some issues.
Also you have two fields named "captain" (which cause problem with registration plugin too).
Here I've created some samples (due to massive code of fields, I'm not putting them here):
Creating fields from JavaScript object and passing em to Registration plugin: http://jsfiddle.net/QwdCv/
Correctly encoded fields in URL passed directly within iframe tag src attribute: http://jsfiddle.net/QwdCv/1/