locked
Manipulate NameValueCollection entries into related groups RRS feed

  • Question

  • User1909155429 posted

    The list below show the Name entries.

     i need to rearrange  the output from the NameValue Collection to a more usable descript name  and add the values from each group represented

    by (number) into another managable list collection type.

    for example; "paymentInfoList.paymentInfo(0).transactionId" renamed  transactionid

    and using the email as key identity in a new sortedlist custom type object like:

    sortedlist.add (email=peter@com, { transactionid=1,transactionstatus=complete,amount=100,primary=false,})

    sortedlist.add (email=steve@yahoo, { transactionid=1,transactionstatus=complete,amount=150,primary=true,})

    sortedlist.add (email=john@yahoo, { transactionid=1,transactionstatus=complete,amount=250,primary=false,})

    each object added to list is retrieved from paymentInfoList.paymentInfo(0). which represents the (n) iteration number.

    ignore the prefix numbers.

     

     

    NameValueCollection
    
    - AllKeys {Length=43} String()
    		(0) "responseEnvelope.timestamp" String
    		(1) "responseEnvelope.ack" String
    		(2) "responseEnvelope.correlationId" String
    		(3) "responseEnvelope.build" String
    		(4) "cancelUrl" String
    		(5) "currencyCode" String
    		(6) "paymentInfoList.paymentInfo(0).transactionId" String
    		(7) "paymentInfoList.paymentInfo(0).transactionStatus" String
    		(8) "paymentInfoList.paymentInfo(0).receiver.amount" String
    		(9) "paymentInfoList.paymentInfo(0).receiver.email" String
    		(10) "paymentInfoList.paymentInfo(0).receiver.primary" String
    		(11) "paymentInfoList.paymentInfo(0).receiver.paymentType" String
    		(12) "paymentInfoList.paymentInfo(0).receiver.accountId" String
    		(13) "paymentInfoList.paymentInfo(0).refundedAmount" String
    		(14) "paymentInfoList.paymentInfo(0).pendingRefund" String
    		(15) "paymentInfoList.paymentInfo(0).senderTransactionId" String
    		(16) "paymentInfoList.paymentInfo(0).senderTransactionStatus" String
    		(17) "paymentInfoList.paymentInfo(1).transactionId" String
    		(18) "paymentInfoList.paymentInfo(1).transactionStatus" String
    		(19) "paymentInfoList.paymentInfo(1).receiver.amount" String
    		(20) "paymentInfoList.paymentInfo(1).receiver.email" String
    		(21) "paymentInfoList.paymentInfo(1).receiver.primary" String
    		(22) "paymentInfoList.paymentInfo(1).receiver.paymentType" String
    		(23) "paymentInfoList.paymentInfo(1).receiver.accountId" String
    		(24) "paymentInfoList.paymentInfo(1).refundedAmount" String
    		(25) "paymentInfoList.paymentInfo(1).pendingRefund" String
    		(26) "paymentInfoList.paymentInfo(1).senderTransactionId" String
    		(27) "paymentInfoList.paymentInfo(1).senderTransactionStatus" String
    		(28) "returnUrl" String
    		(29) "senderEmail" String
    		(30) "status" String
    		(31) "payKey" String
    		(32) "actionType" String
    		(33) "feesPayer" String
    		(34) "reverseAllParallelPaymentsOnError" String
    		(35) "sender.email" String
    		(36) "sender.accountId" String
    		(37) "sender.useCredentials" String

    Friday, September 13, 2013 2:13 PM

Answers

  • User-417640953 posted

    Hello,

    From what I understand that you have more than one NameValueCollection.

    So we suppose there are 3 NameValueCollections like below:

     NameValueCollection[] nvcs=new NameValueCollection[3];
                #region 
                nvcs[0] = new NameValueCollection();
                nvcs[0]["responseEnvelope.timestamp"] = "zzz";
                nvcs[0]["responseEnvelope.ack"] = "zzz";
                nvcs[0]["responseEnvelope.correlationId"] = "zzz";
                nvcs[0]["responseEnvelope.build"] = "zzz";
                nvcs[0]["cancelUrl"] = "zzz";
                nvcs[0]["paymentInfoList.paymentInfo(0).transactionId"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).transactionStatus"] = "complete";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.amount"] = "100";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.email"] = "peter@com";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.primary"] = "true";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.paymentType"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.accountId"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).pendingRefund"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).senderTransactionId"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).senderTransactionStatus"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).transactionId"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).transactionStatus"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).receiver.amount"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).receiver.email"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).receiver.primary"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).receiver.paymentType"] = "1";
                //.........leave out some data
                nvcs[1] = new NameValueCollection();
                nvcs[1]["responseEnvelope.timestamp"] = "zzz";
                nvcs[1]["responseEnvelope.ack"] = "zzz";
                nvcs[1]["responseEnvelope.correlationId"] = "zzz";
                nvcs[1]["responseEnvelope.build"] = "zzz";
                nvcs[1]["cancelUrl"] = "zzz";
                nvcs[1]["paymentInfoList.paymentInfo(0).transactionId"] = "3";
                nvcs[1]["paymentInfoList.paymentInfo(0).transactionStatus"] = "complete";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.amount"] = "150";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.email"] = "steve@yahoo";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.primary"] = "true";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.paymentType"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.accountId"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).pendingRefund"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).senderTransactionId"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).senderTransactionStatus"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).transactionId"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).transactionStatus"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).receiver.amount"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).receiver.email"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).receiver.primary"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).receiver.paymentType"] = "1";
                //.........leave out some data
                nvcs[2] = new NameValueCollection();
                nvcs[2]["responseEnvelope.timestamp"] = "zzz";
                nvcs[2]["responseEnvelope.ack"] = "zzz";
                nvcs[2]["responseEnvelope.correlationId"] = "zzz";
                nvcs[2]["responseEnvelope.build"] = "zzz";
                nvcs[2]["cancelUrl"] = "zzz";
                nvcs[2]["paymentInfoList.paymentInfo(0).transactionId"] = "2";
                nvcs[2]["paymentInfoList.paymentInfo(0).transactionStatus"] = "complete";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.amount"] = "200";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.email"] = "john@yahoo";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.primary"] = "false";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.paymentType"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.accountId"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).pendingRefund"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).senderTransactionId"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).senderTransactionStatus"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).transactionId"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).transactionStatus"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).receiver.amount"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).receiver.email"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).receiver.primary"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).receiver.paymentType"] = "1";
                //.........leave out some data

    For this issue, I suggest you use the Newtonsoft.Json which you can download it online.

    First we should define a class which contains the property we want to show like below.

     public class PaymentInfo { 
            public int transactionId { get; set; }
            public string transactionStatus { get; set; }
            public int amount { get; set; }
            public string email { get; set; }
            public bool primary { get; set; } 
        
        }

    Then do it like below. [Import the namespace Newtonsoft.Json]

                List<PaymentInfo> objectList = new List<PaymentInfo>();
                string str = null;
                //foreach the NameValueCollections
                foreach (var nvc in nvcs) {
                    //get the json string using linq
                     str = "";
                     str= "{"+ string.Join(",",(from key in nvc.Cast<String>()
                     where key.StartsWith("paymentInfoList.paymentInfo(0)")
                     from value in nvc.GetValues(key)
                                            select new
                                            {
                                                key ="\""+ (key.Contains("receiver") ? key.Replace("paymentInfoList.paymentInfo(0).receiver.",""):key.Replace("paymentInfoList.paymentInfo(0).",""))+"\"" , 
                                                
                                                value= "\""+ value+"\""
    
                                            })
                         .Select(p => p.key + ":" + p.value)) +"}";
                     //add a object to our list
                     objectList.Add(JsonConvert.DeserializeObject<PaymentInfo>(str));
                  
                }
                //convert the objectList to our goal 
                var sortedlist = objectList.GroupBy(x => x.email)
                    .ToDictionary(p => "email=" + p.Key, p => p.ToList()
                    .Select(z => new { z.transactionId,z.transactionStatus,z.amount,z.primary }));
    
                //test 
                Response.Write(sortedlist["email=peter@com"].First().amount);

    Sorry for using C#, you can convert it to VB by tool, thanks.

     

    Best Regards!


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 18, 2013 7:56 AM

All replies

  • User-417640953 posted

    Hello,

    According to your description and information you provided, I understand that you want to covert list to dictionary. 

    I’m not sure if I reproduce the scenes below.

     public class Receiver 
        {
            public int amount { get; set; }
            public string email { get; set; }
            public bool primary  { get; set; } 
    
        }
        public class PaymentInfo 
        {
            public int transactionId { get; set; } 
            public string transactionStatus { get; set; }
            public Receiver receiver { get; set; }
        }
        public class PaymentInfoList 
        { 
            public List<PaymentInfo> paymentInfo = null; 
            public PaymentInfoList()
            {
                paymentInfo = new List<PaymentInfo>();
            }  
        }

    Convert:

                PaymentInfoList paymentInfoList = new PaymentInfoList();
                paymentInfoList.paymentInfo.AddRange(new PaymentInfo[] {
                
                new PaymentInfo{ transactionId=1,transactionStatus = "complete", receiver=new Receiver{ amount=100, email="peter@com", primary=true}},
                new PaymentInfo{ transactionId=1,transactionStatus = "complete", receiver=new Receiver{ amount=150, email="steve@com", primary=false}},
                new PaymentInfo{ transactionId=1,transactionStatus = "complete", receiver=new Receiver{ amount=250, email="peter@com", primary=true}}
                });
               
                //convert list to dictionary 
                var map = paymentInfoList.paymentInfo
                    .GroupBy(x => x.receiver.email)
                    .ToDictionary(y => y.Key, y => y.ToList()
                    .Select(z => new { transactionid = z.transactionId,transactionstatus=z.transactionStatus,amount=z.receiver.amount,primary=z.receiver.primary }));
    
                //test
                Response.Write(map["steve@com"].ToList()[0].amount);
                Response.Write(map["steve@com"].ToList()[0].transactionid);

    Sorry for using C# to get that, If necessary please use the tool convert C# to VB below.

    http://www.developerfusion.com/tools/convert/csharp-to-vb

    Thanks.

     

    Regards!

    Sunday, September 15, 2013 2:56 AM
  • User1909155429 posted

    Waw ! thanks for the coded example.

    First i need to iterate through the list and obtain the substring key, such as email, transactionid and relate those according to  sequence number '(0)' that identifies relationships.

    then add them to the list with corresponding values. Whereas you have manually placed key and value in the list.

    this is what makes it more difficult ?

     

    Respects

    Sunday, September 15, 2013 8:40 AM
  • User-417640953 posted

    Hello,

    Sorry for  misunderstanding your issue.

    Would you mind to explain below code?

    peterthegreat

    (6) "paymentInfoList.paymentInfo(0).transactionId" String

    Is it just a string? And how can we  set transactionId=1,transactionstatus=complete?

    Please share more code source to us and let us provide further solution.

     

    Regards!

    Monday, September 16, 2013 2:57 AM
  • User1909155429 posted

    using Paypal transactions i retrieve a response string like this:

     

    responseEnvelope.timestamp=2013-09-16T04%3A48%3A29.711-07%3A00&responseEnvelope.ack=Success&responseEnvelope.correlationId=9f042c3990486&responseEnvelope.build=7630618&cancelUrl=http%3A%2F%2Flocalhost%3A54365%2Fproject110613%2FCheckout%2FCheckout2%2Fpaypaladaptive2.aspx&currencyCode=GBP&paymentInfoList.paymentInfo(0).transactionId=8UJ70716AJ8239532&paymentInfoList.paymentInfo(0).transactionStatus=COMPLETED&paymentInfoList.paymentInfo(0).receiver.amount=2658.00&paymentInfoList.paymentInfo(0).receiver.email=SELLER2%40YAHOO.CO.UK&paymentInfoList.paymentInfo(0).receiver.primary=false&paymentInfoList.paymentInfo(0).receiver.paymentType=GOODS&paymentInfoList.paymentInfo(0).receiver.accountId=CKVK2NJ5CGHFU&paymentInfoList.paymentInfo(0).refundedAmount=0.00&paymentInfoList.paymentInfo(0).pendingRefund=false&paymentInfoList.paymentInfo(0).senderTransactionId=71U09256TG131793H&paymentInfoList.paymentInfo(0).senderTransactionStatus=COMPLETED&returnUrl=http%3A%2F%2Flocalhost%3A54365%2Fproject%2FCheckout%2FCheckout2%2FCheckoutReview.aspx

    then the string is decoded and stored in NameValueCollection where it appears as previous defined, minus the values.

    if anyone can you can !


     

    Monday, September 16, 2013 7:57 AM
  • User-417640953 posted

    Hello,

    From what I understand that you have more than one NameValueCollection.

    So we suppose there are 3 NameValueCollections like below:

     NameValueCollection[] nvcs=new NameValueCollection[3];
                #region 
                nvcs[0] = new NameValueCollection();
                nvcs[0]["responseEnvelope.timestamp"] = "zzz";
                nvcs[0]["responseEnvelope.ack"] = "zzz";
                nvcs[0]["responseEnvelope.correlationId"] = "zzz";
                nvcs[0]["responseEnvelope.build"] = "zzz";
                nvcs[0]["cancelUrl"] = "zzz";
                nvcs[0]["paymentInfoList.paymentInfo(0).transactionId"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).transactionStatus"] = "complete";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.amount"] = "100";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.email"] = "peter@com";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.primary"] = "true";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.paymentType"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).receiver.accountId"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).pendingRefund"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).senderTransactionId"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(0).senderTransactionStatus"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).transactionId"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).transactionStatus"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).receiver.amount"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).receiver.email"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).receiver.primary"] = "1";
                nvcs[0]["paymentInfoList.paymentInfo(1).receiver.paymentType"] = "1";
                //.........leave out some data
                nvcs[1] = new NameValueCollection();
                nvcs[1]["responseEnvelope.timestamp"] = "zzz";
                nvcs[1]["responseEnvelope.ack"] = "zzz";
                nvcs[1]["responseEnvelope.correlationId"] = "zzz";
                nvcs[1]["responseEnvelope.build"] = "zzz";
                nvcs[1]["cancelUrl"] = "zzz";
                nvcs[1]["paymentInfoList.paymentInfo(0).transactionId"] = "3";
                nvcs[1]["paymentInfoList.paymentInfo(0).transactionStatus"] = "complete";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.amount"] = "150";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.email"] = "steve@yahoo";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.primary"] = "true";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.paymentType"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).receiver.accountId"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).pendingRefund"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).senderTransactionId"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(0).senderTransactionStatus"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).transactionId"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).transactionStatus"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).receiver.amount"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).receiver.email"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).receiver.primary"] = "1";
                nvcs[1]["paymentInfoList.paymentInfo(1).receiver.paymentType"] = "1";
                //.........leave out some data
                nvcs[2] = new NameValueCollection();
                nvcs[2]["responseEnvelope.timestamp"] = "zzz";
                nvcs[2]["responseEnvelope.ack"] = "zzz";
                nvcs[2]["responseEnvelope.correlationId"] = "zzz";
                nvcs[2]["responseEnvelope.build"] = "zzz";
                nvcs[2]["cancelUrl"] = "zzz";
                nvcs[2]["paymentInfoList.paymentInfo(0).transactionId"] = "2";
                nvcs[2]["paymentInfoList.paymentInfo(0).transactionStatus"] = "complete";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.amount"] = "200";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.email"] = "john@yahoo";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.primary"] = "false";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.paymentType"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).receiver.accountId"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).pendingRefund"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).refundedAmount"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).senderTransactionId"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(0).senderTransactionStatus"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).transactionId"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).transactionStatus"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).receiver.amount"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).receiver.email"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).receiver.primary"] = "1";
                nvcs[2]["paymentInfoList.paymentInfo(1).receiver.paymentType"] = "1";
                //.........leave out some data

    For this issue, I suggest you use the Newtonsoft.Json which you can download it online.

    First we should define a class which contains the property we want to show like below.

     public class PaymentInfo { 
            public int transactionId { get; set; }
            public string transactionStatus { get; set; }
            public int amount { get; set; }
            public string email { get; set; }
            public bool primary { get; set; } 
        
        }

    Then do it like below. [Import the namespace Newtonsoft.Json]

                List<PaymentInfo> objectList = new List<PaymentInfo>();
                string str = null;
                //foreach the NameValueCollections
                foreach (var nvc in nvcs) {
                    //get the json string using linq
                     str = "";
                     str= "{"+ string.Join(",",(from key in nvc.Cast<String>()
                     where key.StartsWith("paymentInfoList.paymentInfo(0)")
                     from value in nvc.GetValues(key)
                                            select new
                                            {
                                                key ="\""+ (key.Contains("receiver") ? key.Replace("paymentInfoList.paymentInfo(0).receiver.",""):key.Replace("paymentInfoList.paymentInfo(0).",""))+"\"" , 
                                                
                                                value= "\""+ value+"\""
    
                                            })
                         .Select(p => p.key + ":" + p.value)) +"}";
                     //add a object to our list
                     objectList.Add(JsonConvert.DeserializeObject<PaymentInfo>(str));
                  
                }
                //convert the objectList to our goal 
                var sortedlist = objectList.GroupBy(x => x.email)
                    .ToDictionary(p => "email=" + p.Key, p => p.ToList()
                    .Select(z => new { z.transactionId,z.transactionStatus,z.amount,z.primary }));
    
                //test 
                Response.Write(sortedlist["email=peter@com"].First().amount);

    Sorry for using C#, you can convert it to VB by tool, thanks.

     

    Best Regards!


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 18, 2013 7:56 AM
  • User1909155429 posted

    There is only one collection of data provided as supplied.

     

    the new collection should look as follows,. create a aliase key name for each paymentInfoList.paymentInfo(0). element using the substring ( e.g transactionid), including key identity as email

    seller1@yahoo , {transactionid =1,transactionstatus="complete",amount="150"....}

    seller2@yahoo, {transactionid =1,transactionstatus="complete",amount="200"....}

    etc

    the other remaining key/value items can be removed from list and added to another list collection !

     

    Wednesday, September 18, 2013 11:53 AM
  • User1909155429 posted

    Thanks again for your valued support.

    Thoughts i wish to share on the subject discussion

    i am wondering if you could group on email and replace whole key name with aliase email name.

    Group this :   paymentInfoList.paymentInfo(n).receiver.email

    but before able to perform such a query seperate the other elements that do not possess similar key name structure like: responseEnvelope.timestamp from collection into another collection.

    Also, curious to know how to count the number of different (n) in collection that represents each collective group ?

     

    Wednesday, September 18, 2013 12:56 PM
  • User1909155429 posted

    Did you go to Harvard ?

    In relation to the topic, can you explain what is the function of the deserialiser in this matter ?

    and at the same time how do you count the number of   (n) collection group instances ?

    Appreciated. 

    Thursday, September 19, 2013 7:24 AM