Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何读取Java中没有名称的元素的JSON响应(SurveyGizmo survey Response API)_Java_Json - Fatal编程技术网

如何读取Java中没有名称的元素的JSON响应(SurveyGizmo survey Response API)

如何读取Java中没有名称的元素的JSON响应(SurveyGizmo survey Response API),java,json,Java,Json,我正在使用surveygizmo API检索调查响应,但是在他们的JSON响应(下面的示例)中,我遇到了两个问题 我将如何迭代这个问题:答案对,似乎没有与之关联的字段名,因此我无法执行JSONObject.getJSONObject(“字段名”);或JSONArray.getJSONArray(“字段名”);由于调查的跳过逻辑,我不知道我需要输入什么问题ID,所以我也无法通过“问题(#)” 我需要问题的questionId,但是考虑到键是“[question(#))”,既然我不相信它是JSONO

我正在使用surveygizmo API检索调查响应,但是在他们的JSON响应(下面的示例)中,我遇到了两个问题

  • 我将如何迭代这个问题:答案对,似乎没有与之关联的字段名,因此我无法执行JSONObject.getJSONObject(“字段名”);或JSONArray.getJSONArray(“字段名”);由于调查的跳过逻辑,我不知道我需要输入什么问题ID,所以我也无法通过“问题(#)”

  • 我需要问题的questionId,但是考虑到键是“[question(#))”,既然我不相信它是JSONObject或JSONArray,我应该如何获得questionId,我应该将它视为字符串并执行正则表达式搜索以检索“question()”中的#

  • JSONResponse示例

    {
        "result_ok":true,
        "total_count":"1",
        "page":1,
        "total_pages":1,
        "results_per_page":50,
        "data":[{
            "id":"1",
            "contact_id":"",
            "status":"Complete",
            "is_test_data":"1",
            "datesubmitted":"2013-02-07 12:00:00",
            "sResponseComment":"",
            "[question(3)]":"15",
            "[question(4), option(10003)]":"Baseball",
            "[question(4), option(10007)]":"Basketball",
            "[question(4), option(10009)]":"Hockey",
            "[question(12)]":"No",
            "[question(14)]":"Yes",
            "[question(15)]":"Abc",
            "[question(16)]":"No"
       }]
    }
    

    您需要手工解析问题“number”关键数据


    如果您没有预料到该格式会有很多变化,那么可以使用正则表达式,或者您可以构建一个简单的“解析器”,在逗号上拆分,并使用解析后的数据构建POJO。

    您需要手工解析问题“number”键数据


    如果您不希望该格式有太多的变化,您可以使用正则表达式,或者您可以构建一个简单的“解析器”,在逗号上拆分,并使用解析后的数据构建POJO。

    我一直在从事类似的项目。这是我到目前为止所拥有的

    Model.cs:

    using Newtonsoft.Json;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading.Tasks;
    
    namespace DeSerializer
    {
        [JsonObject]
        public class Responses
        {
            public bool result_ok { get; set; }
            public string total_count { get; set; }
        public int page { get; set; }
        public int total_pages { get; set; }
        public int results_per_page { get; set; }
        public SurveyResponse[] Data { get; set; }
    }
    
    [JsonObject]
    // Here is the magic: When you see this type, use this class to read it.
    // If you want, you can also define the JsonConverter by adding it to
    // a JsonSerializer, and parsing with that.
    [JsonConverter(typeof(DataItemConverter))]
    public class SurveyResponse
    {
        public string id { get; set; }
        public string contact_id { get; set; }
        public string status { get; set; }
        public string is_test_data { get; set; }
        public DateTime datesubmitted { get; set; }
        public string sResponseComment { get; set; }
        public List<SurveyQuestion> SurveyQuestions { get; set; }
        public List<SurveyUrl> SurveyUrls { get; set; }
        public List<SurveyGeoData> SurveyGeoDatas { get; set; }
        public List<SurveyVariable> SurveyVariables { get; set; }
        public List<SurveyVariableShown> SurveyVariableShowns { get; set; }
        public List<SurveyQuestionHidden> SurveyQuestionHiddens { get; set; }
        public List<SurveyQuestionOption> SurveyQuestionOptions { get; set; }
        public List<SurveyQuestionMulti> SurveyQuestionMulties { get; set; }
    }
    
    public class SurveyQuestion
    {
        [Key]
        public int QuestionID { get; set; }
        public string QuestionResponse { get; set; }
    }
    
    public class SurveyUrl
    {
        [Key]
        public int SurveyUrlID { get; set; }
        public string Name { get; set; }
        public string Value { get; set; }
    }
    
    public class SurveyGeoData
    {
        [Key]
        public int SurveyGeoDataID { get; set; }
        public string Name { get; set; }
        public string Value { get; set; }
    }
    
    public class SurveyVariable
    {
        [Key]
        public int SurveyVariableID { get; set; }
        public string Value { get; set; }
    }
    
    public class SurveyVariableShown
    {
        [Key]
        public int SurveyVariableShownID { get; set; }
        public string Name { get; set; }
        public string Value { get; set; }
    }
    
    public class SurveyQuestionHidden
    {
        [Key]
        public int QuestionID { get; set; }
        public string QuestionResponse { get; set; }
    }
    
    public class SurveyQuestionOption
    {
        [Key]
        public int OptionID { get; set; }
        public int QuestionID { get; set; }
        public string QuestionResponse { get; set; }
    }
    
    public class SurveyQuestionMulti
    {
        [Key]
        public int OptionID { get; set; }
        public int QuestionID { get; set; }
        public string QuestionResponse { get; set; }
    }
    
    public class DataItemConverter : JsonConverter
    {
        public override bool CanConvert(Type objectType)
        {
            return objectType == typeof(SurveyResponse);
        }
    
        public override bool CanRead
        {
            get { return true; }
        }
    
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var value = (SurveyResponse)existingValue;
            if (value == null)
            {
                value = new SurveyResponse();
                value.SurveyQuestions = new List<SurveyQuestion>();
                value.SurveyUrls = new List<SurveyUrl>();
                value.SurveyGeoDatas = new List<SurveyGeoData>();
                value.SurveyVariables = new List<SurveyVariable>();
                value.SurveyVariableShowns = new List<SurveyVariableShown>();
                value.SurveyQuestionHiddens = new List<SurveyQuestionHidden>();
                value.SurveyQuestionOptions = new List<SurveyQuestionOption>();
                value.SurveyQuestionMulties = new List<SurveyQuestionMulti>();
            }
    
            // Skip opening {
            reader.Read();
    
            while (reader.TokenType == JsonToken.PropertyName)
            {
                var name = reader.Value.ToString();
                reader.Read();
    
                // Here is where you do your magic
                string input = name;
    
                //[question(1)]
                //[question(11)]
                //[question(111)]
                //[question(1234)]
                //[question(12345)]
                //[url(12345)]
                //[variable(12345)]
                //SINGLE ANSWER
                Match matchSingleAnswer = Regex.Match(input, @"\[(question|calc|comment)\(([0-9]{5}|[0-9]{4}|[0-9]{3}|[0-9]{2}|[0-9]{1})\)]",
                    RegexOptions.IgnoreCase);
    
    
                //SINGLE VARIABLE
                Match matchSingleVariable = Regex.Match(input, @"\[(variable)\(([0-9]{5}|[0-9]{4}|[0-9]{3}|[0-9]{2}|[0-9]{1})\)]",
                    RegexOptions.IgnoreCase);
    
                //URL
                Match matchUrl = Regex.Match(input, @"\[url",
                    RegexOptions.IgnoreCase);
    
                //GEO DATA
                Match matchGeo = Regex.Match(input, @"\[variable\(""STANDARD_",
                    RegexOptions.IgnoreCase);
    
                //VARIABLES SHOWN
                Match matchVariables = Regex.Match(input, @"\[variable",
                    RegexOptions.IgnoreCase);
    
                //[question(1), option(\"1
                //[question(11), option(\"2
                //[question(111), option(\"1
                //[question(1234), option(\"1
                //[question(12345), option(\"1
                ////////////////////////////////////////////
                ////////The \ values are being removed.
                ////////////////////////////////////////////
                //OPTIONAL ANSWERS
                string myReg = @"\[(question|url|variable|calc|comment)\(([0-9]{5}|[0-9]{4}|[0-9]{3}|[0-9]{2}|[0-9]{1})\),\ option\(""[0-9]";
                Match matchOption = Regex.Match(input, myReg,
                    RegexOptions.IgnoreCase);
    
                //[question(1), option(1
                //[question(11), option(2
                //[question(111), option(1
                //[question(1234), option(1
                //[question(12345), option(1
                //MULTIPLE CHOICE
                Match matchMultiSelect = Regex.Match(input, @"\[question\(([0-9]{5}|[0-9]{4}|[0-9]{3}|[0-9]{2}|[0-9]{1})\),\ option\([0-9]",
                    RegexOptions.IgnoreCase);
    
    
    
                //[question(1), option(0)
                //[question(11), option(0)
                //[question(111), option(0)
                //[question(1234), option(0)
                //[question(12345), option(0)
                //HIDDEN
                Match matchHiddenValue = Regex.Match(input, @"\[question\(([0-9]{5}|[0-9]{4}|[0-9]{3}|[0-9]{2}|[0-9]{1})\),\ option\(0\)",
                    RegexOptions.IgnoreCase);
    
    
                if (matchSingleAnswer.Success)
                {
                    int index = int.Parse(name.Substring(10, name.IndexOf(')') - 10));
                    SurveyQuestion sq = new SurveyQuestion();
                    sq.QuestionID = index;
                    sq.QuestionResponse = serializer.Deserialize<string>(reader);
                    value.SurveyQuestions.Add(sq);
                }
                else if (matchUrl.Success)
                {
                    string urlName = name.Substring(6, name.Length - 9);
                    SurveyUrl su = new SurveyUrl();
                    su.Name = urlName;
                    su.Value = serializer.Deserialize<string>(reader);
                    value.SurveyUrls.Add(su);
                }
                else if (matchGeo.Success)
                {
                    string geoName = name.Substring(11, name.Length - 14);
                    SurveyGeoData sgd = new SurveyGeoData();
                    sgd.Name = geoName;
                    sgd.Value = serializer.Deserialize<string>(reader);
                    value.SurveyGeoDatas.Add(sgd);
                }
                else if (matchSingleVariable.Success)
                {
                    int index = int.Parse(name.Substring(10, name.IndexOf(')') - 10));
                    SurveyVariable sv = new SurveyVariable();
                    sv.SurveyVariableID = index;
                    sv.Value = serializer.Deserialize<string>(reader);
                    value.SurveyVariables.Add(sv);
                }
                else if (matchVariables.Success)
                {
                    string varName = name.Substring(11, name.Length - 14);
                    SurveyVariableShown svs = new SurveyVariableShown();
                    svs.Name = varName;
                    svs.Value = serializer.Deserialize<string>(reader);
                    value.SurveyVariableShowns.Add(svs);
                }
                else if (matchHiddenValue.Success)
                {
                    int index = int.Parse(name.Substring(10, name.IndexOf(')') - 10));
                    SurveyQuestionHidden sqh = new SurveyQuestionHidden();
                    sqh.QuestionID = index;
                    sqh.QuestionResponse = serializer.Deserialize<string>(reader);
                    value.SurveyQuestionHiddens.Add(sqh);
                }
                else if (matchMultiSelect.Success)
                {
                    //Multiple choice question selections
                    string[] nameArray = name.Split(')');
                    string questionPart = nameArray[0];
                    string optionPart = nameArray[1];
                    int index = int.Parse(questionPart.Substring(10, questionPart.Length - 10));
                    int indexSub = int.Parse(optionPart.Substring(9, optionPart.Length - 9));
    
                    SurveyQuestionMulti sqm = new SurveyQuestionMulti();
                    sqm.OptionID = indexSub;
                    sqm.QuestionID = index;
                    sqm.QuestionResponse = serializer.Deserialize<string>(reader);
                    value.SurveyQuestionMulties.Add(sqm);
    
                    //NEED TO ADD A BASE QUESTION TO POINT TO ALL THE MULTI
                    //SurveyQuestion sq = new SurveyQuestion();
                    //sq.QuestionID = sqm.QuestionID;
                    //sq.QuestionResponse = "";
                    //value.SurveyQuestions.Add(sq);
                }
                else if (matchOption.Success)
                {
                    //Optional text value for a given question
                    string[] nameArray = name.Split(')');
                    string questionPart = nameArray[0];
                    string optionPart = nameArray[1];
                    int index = int.Parse(questionPart.Substring(10, questionPart.Length - 10));
                    int indexSub = int.Parse(optionPart.Substring(10, 5));
    
                    SurveyQuestionOption sqo = new SurveyQuestionOption();
                    sqo.OptionID = indexSub;
                    sqo.QuestionID = index;
                    sqo.QuestionResponse = serializer.Deserialize<string>(reader);
                    value.SurveyQuestionOptions.Add(sqo);
                }
                else
                {
                    var property = typeof(SurveyResponse).GetProperty(name);
                    if (property != null)
                        property.SetValue(value, serializer.Deserialize(reader, property.PropertyType), null);
                }
    
                // Skip the , or } if we are at the end
                reader.Read();
            }
    
            return value;
        }
    
        public override bool CanWrite
        {
            get { return false; }
        }
    
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            throw new NotImplementedException();
        }
    }
    }
    
    使用Newtonsoft.Json;
    使用制度;
    使用System.Collections.Generic;
    使用System.ComponentModel.DataAnnotations;
    使用System.Linq;
    使用系统文本;
    使用System.Text.RegularExpressions;
    使用System.Threading.Tasks;
    命名空间反序列化器
    {
    [JsonObject]
    公众课堂反应
    {
    公共bool result_ok{get;set;}
    公共字符串总计数{get;set;}
    公共整型页{get;set;}
    公共int总页数{get;set;}
    公共int结果每_页{get;set;}
    公共调查响应[]数据{get;set;}
    }
    [JsonObject]
    //神奇之处在于:当您看到这种类型时,使用这个类来阅读它。
    //如果需要,还可以通过将JsonConverter添加到
    //JsonSerializer,并使用它进行解析。
    [JsonConverter(类型(DataItemConverter))]
    公共类调查响应
    {
    公共字符串id{get;set;}
    公共字符串联系人_id{get;set;}
    公共字符串状态{get;set;}
    公共字符串是_test_data{get;set;}
    public DateTime datesubmitted{get;set;}
    公共字符串sResponseComment{get;set;}
    公共列表调查问题{get;set;}
    公共列表调查{get;set;}
    公共列表SurveyGeoDatas{get;set;}
    公共列表调查变量{get;set;}
    公共列表调查变量showns{get;set;}
    公共列表调查问题隐藏{get;set;}
    公共列表调查问题选项{get;set;}
    公共列表调查问题集{get;set;}
    }
    公开课调查问题
    {
    [关键]
    public int QuestionID{get;set;}
    公共字符串QuestionResponse{get;set;}
    }
    公共类调查
    {
    [关键]
    公共int-SurveyUrlID{get;set;}
    公共字符串名称{get;set;}
    公共字符串值{get;set;}
    }
    公共类调查地理数据
    {
    [关键]
    public int SurveyGeoDataID{get;set;}
    公共字符串名称{get;set;}
    公共字符串值{get;set;}
    }
    公共类调查变量
    {
    [关键]
    公共int SurveyVariableID{get;set;}
    公共字符串值{get;set;}
    }
    公共类调查变量如图所示
    {
    [关键]
    public int SurveyVariableShownID{get;set;}
    公共字符串名称{get;set;}
    公共字符串值{get;set;}
    }
    公共类调查问题隐藏
    {
    [关键]
    public int QuestionID{get;set;}
    公共字符串QuestionResponse{get;set;}
    }
    公共类调查问题选项
    {
    [关键]
    public int OptionID{get;set;}
    public int QuestionID{get;set;}
    公共字符串QuestionResponse{get;set;}
    }
    公共课堂调查问题
    {
    [关键]
    public int OptionID{get;set;}
    public int QuestionID{get;set;}
    公共字符串QuestionResponse{get;set;}
    }
    公共类DataItemConverter:JsonConverter
    {
    公共覆盖布尔CanConvert(类型objectType)
    {
    返回objectType==typeof(SurveyResponse);
    }
    公共覆盖布尔可读取
    {
    获取{return true;}
    }
    公共重写对象ReadJson(JsonReader阅读器,类型objectType,对象existingValue,JsonSerializer序列化程序)
    {
    var值=(SurveyResponse)现有值;
    如果(值==null)
    {
    值=新的SurveyResponse();
    value.SurveyQuestions=新列表();
    value.SurveyUrls=新列表();
    value.SurveyGeoDatas=新列表();
    value.SurveyVariables=新列表();
    value.SurveyVariableShowns=新列表();
    value.SurveyQuestionHiddens=新列表();
    value.SurveyQuestionOptions=新列表();
    value.SurveyQuestionMulties=新列表();
    }
    //跳开{
    reader.Read();
    while(reader.TokenType==JsonToken.PropertyName)
    {
    var name=reader.Value.ToString();
    reader.Read();
    //这是你施展魔法的地方
    字符串输入=名称;
    //[问题(1)]
    //[问题(11)]
    //[问题(111)]
    //[问题(1234)]
    //[问题(12345)]
    //[网址(12345)]
    //[变量(12345)]
    //单一答案
    Match matchSingleAnswer=Regex.Match(输入,@“\[(问题^计算^注释)\([0-9]{5}{124;[0-9]{4}{124;[0-9]{3}{124;[0-9]{2}{124;[0-9]{1}])”,
    RegexOptions.IgnoreCase);
    //单变量
    Match matchSingleVariable=Regex.Match(输入,@“\[(变量)\([0-9]{5}{124;[0-9]{4}{124;[0-9]{3}{124;[0-9]{2}{124;[0-9]{1})],
    
                string webReq = String.Empty;
    
            //Office Energy - Allan Testing
            webReq += "https://restapi.surveygizmo.com/head/survey/xxxxxx";
            webReq += "/surveyresponse/";
            webReq += "?user:pass=xxxxxxxx:xxxxxxx";
            webReq += "&page=101&resultsperpage=1";
    
            HttpWebRequest request = WebRequest.Create(webReq) as HttpWebRequest;
            var results = String.Empty;
            using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
            {
                StreamReader reader = new StreamReader(response.GetResponseStream());
                results += reader.ReadToEnd();
            }
    
    
            Responses responses = new JavaScriptSerializer().Deserialize<Responses>(results);
    
    
            Console.WriteLine("FEED HEADERS:");
            Console.WriteLine("");
            Console.WriteLine("result_ok: " + responses.result_ok);
            Console.WriteLine("total_count: " + responses.total_count);
            Console.WriteLine("page: " + responses.page);
            Console.WriteLine("total_pages: " + responses.total_pages);
            Console.WriteLine("results_per_page: " + responses.results_per_page);
            Console.WriteLine("");
            Console.WriteLine("");
    
    
            foreach (var item in responses.Data)
            {
                Console.WriteLine("id: " + item.id);
                Console.WriteLine("contact_id: " + item.contact_id);
                Console.WriteLine("status: " + item.status);
                Console.WriteLine("is_test_data: " + item.is_test_data);
                Console.WriteLine("datesubmitted: " + item.datesubmitted);
                Console.WriteLine("sResponseComment: " + item.sResponseComment);
                Console.WriteLine("");
            }
    
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
    
            //using live stream
            var result = JsonConvert.DeserializeObject<Responses>(results);
            //local results (not using live stream)
            //var result = JsonConvert.DeserializeObject<Responses>(localResults);
    
    
            //want to calcualte the highest kay number for the loop
            //http://stackoverflow.com/questions/2805703/good-way-to-get-the-key-of-the-highest-value-of-a-dictionary-in-c-sharp
            //var max = result.Data[0].questions[0].Aggregate((l, r) => l.Key > r.Key ? l : r).Key;
    
    
            foreach (var item in result.Data[0].SurveyQuestions)
            {
                string label = "QuestionID = " + item.QuestionID;
                string val = "QuestionResponse = " + item.QuestionResponse;
                Console.WriteLine(label);
                Console.WriteLine(val);
                Console.WriteLine("");
    
    
                //Question Option
                var listOptions = result.Data[0].SurveyQuestionOptions;
                var listLocalQuestionOptions = from o in listOptions
                                               where o.QuestionID == item.QuestionID
                                               select o;
                foreach (var itemSub in listLocalQuestionOptions)
                {
                    Console.WriteLine("  OPTIONAL");
                    string labelSub1 = "  OptionID = " + itemSub.OptionID;
                    string labelSub2 = "  QuestionID = " + itemSub.QuestionID;
                    string valSub1 = "  QuestionResponse = " + itemSub.QuestionResponse;
                    Console.WriteLine(labelSub1);
                    Console.WriteLine(labelSub2);
                    Console.WriteLine(valSub1);
                    Console.WriteLine("");
                }
    
    
                //Question Multi
                var listMulties = result.Data[0].SurveyQuestionMulties;
                var listLocalQuestionMulties = from m in listMulties
                                               where m.QuestionID == item.QuestionID
                                               select m;
                foreach (var itemSub in listLocalQuestionMulties)
                {
                    Console.WriteLine("MULTIES");
                    string labelSub1 = "  OptionID = " + itemSub.OptionID;
                    string labelSub2 = "  QuestionID = " + itemSub.QuestionID;
                    string valSub1 = "  QuestionResponse = " + itemSub.QuestionResponse;
                    Console.WriteLine(labelSub1);
                    Console.WriteLine(labelSub2);
                    Console.WriteLine(valSub1);
                    Console.WriteLine("");
                }
    
    
            }
    
            //Console.WriteLine("");
            //Console.WriteLine("");
            //Console.WriteLine("");
            //Console.WriteLine("");
    
            //foreach (var item in result.Data[0].SurveyQuestionOptions)
            //{
            //    string label = "OptionID = " + item.OptionID;
            //    string label2 = "QuestionID = " + item.QuestionID;
            //    string val = "QuestionResponse = " + item.QuestionResponse;
            //    Console.WriteLine(label);
            //    Console.WriteLine(label2);
            //    Console.WriteLine(val);
            //    Console.WriteLine("");
            //}
    
            //Console.WriteLine("");
    
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
    
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("HIDDENS");
            Console.WriteLine("");
    
            foreach (var item in result.Data[0].SurveyQuestionHiddens)
            {
                string label = "QuestionID = " + item.QuestionID;
                string val = "QuestionResponse = " + item.QuestionResponse;
                Console.WriteLine(label);
                Console.WriteLine(val);
                Console.WriteLine("");
            }
    
    
    
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("MULTIES");
            Console.WriteLine("");
    
            foreach (var item in result.Data[0].SurveyQuestionMulties)
            {
                string label = "OptionID = " + item.OptionID;
                string label2 = "QuestionID = " + item.QuestionID;
                string val = "QuestionResponse = " + item.QuestionResponse;
                Console.WriteLine(label);
                Console.WriteLine(label2);
                Console.WriteLine(val);
                Console.WriteLine("");
            }
    
    
    
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("URL VALUES");
            Console.WriteLine("");
    
            foreach (var item in result.Data[0].SurveyUrls)
            {
                string label = "SurveyUrlID = " + item.SurveyUrlID;
                string label2 = "Name = " + item.Name;
                string val = "Value = " + item.Value;
                Console.WriteLine(label);
                Console.WriteLine(label2);
                Console.WriteLine(val);
                Console.WriteLine("");
            }
    
    
    
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("GEO VALUES");
            Console.WriteLine("");
    
            foreach (var item in result.Data[0].SurveyGeoDatas)
            {
                string label = "SurveyGeoDataID = " + item.SurveyGeoDataID;
                string label2 = "Name = " + item.Name;
                string val = "Value = " + item.Value;
                Console.WriteLine(label);
                Console.WriteLine(label2);
                Console.WriteLine(val);
                Console.WriteLine("");
            }
    
    
    
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("VARIABLES");
            Console.WriteLine("");
    
            foreach (var item in result.Data[0].SurveyVariables)
            {
                string label = "SurveyVariableID = " + item.SurveyVariableID;
                string val = "Value = " + item.Value;
                Console.WriteLine(label);
                Console.WriteLine(val);
                Console.WriteLine("");
            }
    
    
    
            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
            Console.WriteLine("");
            Console.WriteLine("");
            Console.WriteLine("VARIABLES SHOWN");
            Console.WriteLine("");
    
            foreach (var item in result.Data[0].SurveyVariableShowns)
            {
                string label = "SurveyVariableShownID = " + item.SurveyVariableShownID;
                string label2 = "Name = " + item.Name;
                string val = "Value = " + item.Value;
                Console.WriteLine(label);
                Console.WriteLine(label2);
                Console.WriteLine(val);
                Console.WriteLine("");
            }
    
    
    
    
            Console.WriteLine("");
            Console.WriteLine("Press enter to exit...");
            Console.ReadLine();