How to extract string in JSON data where the value in a table

Hello

Structure of JSON string

{'name': 'John', 'name': 'kumar', 'address': [{'Address1': 'value', 'place': 'value'}, {'address2': 'value', 'place': 'value'}]}

 


How to extract the value of the address of the list.

If you have control over the format of data, it is best to rename address1 and address2 to have the same name, for example "address". Then, it can be analyzed that way (I've also simplified other code a bit):

JsonDataAccess jda;
QVariant v = jda.loadFromBuffer(jsonString);
QVariantMap m = v.toMap();
QString name = m["name"].toString();
QString surname = m["surname"].toString();
QVariantList addresses = m["address"].toList();
foreach (QVariant addr, addresses)
{  QVariantMap addrMap = addr.toMap();
  QString addressValue = addrMap["address"].toString();
  QString place = addrMap["place"].toString();
}

Tags: BlackBerry Developers

Similar Questions

  • In the date picker, how can I default to select * dates if the user has...

    In the date picker, how can I default to select * dates if the user does not select a date.
    Thank you
    Doug

    Doug,

    Now lets say l want everything
    

    Could you post some sample data and the output you want to get... ? It would be very easy to understand the requirements...

    When you mean everything, I guess you need all possible dates between date1 and date2.

    You can use... (to asktom.oracle.com).

      1  select to_date('12-jan-2009','DD-MON-YYYY') + rownum -1
      2    from ALL_OBJECTS
      3    where rownum <= (to_date('20-jan-2009','dd-mon-yyyy') -
      4*                     to_date('12-jan-2009','DD-MON-YYYY') +1 )
    sql> /
    
    TO_DATE('
    ---------
    12-JAN-09
    13-JAN-09
    14-JAN-09
    15-JAN-09
    16-JAN-09
    17-JAN-09
    18-JAN-09
    19-JAN-09
    20-JAN-09
    
    9 rows selected.
    
    For your case, since you have date1 and date2...
    
    select to_date(:p12_date1,'DD-MON-YYYY') + rownum -1
      from ALL_OBJECTS
      where rownum <= (to_date(:p12_date2,'dd-mon-yyyy') -
                        to_date(:p12_date1,'DD-MON-YYYY') +1 )
    

    Should work... in my opinion... Have not tested the other by their Summit.

    Is that what you're looking for... ?? If no, please give details...

    Thank you
    Rajesh.

  • How can I recharge my sim data in the air of the ipad 2 and activate?

    How can I recharge my sim data in the air of the ipad 2 and activate?

    Hi asherfromqatar,

    The resources below explains how to activate cellular data on your iPad 2 Air service.

    Activate the service of cellular data on your iPad iPad, iPad 2 Air and Pro 3 mini or later

    Check or change your cellular data plan

    To check the status of your cellular data or make changes to your plan, go to settings > cellular data.

    To add another data plan to your iPad, tap Settings > cellular data > Data Plan > add a new Plan.

    When you activate a cell data with some carriers plan, your SIM Apple could be dedicated to the corporate network. Your iPad is unlocked so that you can buy an another SIM Apple or a standard carrier nano-SIM allows you to change networks. Learn more about dedicated SIMs.

    Get help

    Get help with your Apple SIM if you have one of these problems:

    • You receive an alert on your Apple SIM
    • You cannot activate a service or can't find certain support
    • You cannot connect to the cellular data network

    Take care

  • call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. The other rows are based on the entities

    Hi Experts,

    JDeveloper 12.1.3.0.0

    I have a VO based on entity object. With a column of the VO is transient attribute (I created).

    I need to call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. As well as other attributes.

    So can anyone suggest how can I achieve this?

    Thank you

    AR

    I think that you need a stored function (which returns the value) in this case, is not?

    Take a look at:

    https://docs.Oracle.com/CD/B31017_01/Web.1013/b25947/bcadvgen005.htm

    and search for:

    Invoking stored function with only Arguments in

    call your function in the Get attribute and return value accessor...

  • Sales order form, line status code is displayed as "WITHDRAWN". but the same code appears as "AWAITING_SHIPPING" for the same line in the database. can you please explain, where the value in frontend comes? It differs from the flow_status_code in oe_or

    Sales order form, line status code is displayed as "WITHDRAWN". but the same code appears as "AWAITING_SHIPPING" for the same line in the database.

    Where the value in the frontend is filling?

    It differs from the flow_status_code in oe_order_lines_all?

    Thanks for the correction.

    He slipped right out of my mind!

    Here is a detailed explanation of this case:

    Status of orders picked and picked partial

    Kind regards

    Bashar

  • Request to remove row where the value of column contains alphabets

    Hello

    Could someone please help me to get this application working.

    Request to remove row where the value of column contains alphabets.

    DELETE FROM BIN_ITEM WHERE order_nmb LIKE '% [A - Z] % ' | LIKE '% [a - z] %'

    Thank you and best regards,

    Madam.

    SELECT order_nmb FROM BIN_ITEM WHERE regexp_count(order_nmb,'[0-9]') = 0

    ----

    Ramin Hashimzade

  • How to load the values into a table?

    In my jspx page, I have a combo and a table... Based on the values of the drop-down list, when I click on a button, I want to load the values into a table... The data in the table are from 5 database tables. I created a viewObject readonly... What to do to load the values from the table, I click on a button?

    Ensure that you have defined a variable to bind your view object.

    Read-only or not, this is what would make the Execute with action of parameters available.

    John

  • How can insert different types of data in the table?

    Hello
    How can I insert different types of data in the table, (e.g., numeric and string) in the same index of a table.

    example:
    index0 car 10 green

    car red 11 index1
    Index2 car Blue 12

    where green car red and blue car as string and 10, 11 and 12 in the numeric form.
    then I extracted 10, 11 and 12 a digital table

    and, the green car, red car, blue car in a string array

    Help!

    Use 'Analysis of the chain' as in the picture as an attachment.  This will extract the number and color that you can add tables later.

  • view the json data in the custom list field

    Hi, I did analysis json and I created the custom list field. Now, I want to display only the data analyzed in my custom list field. I'll post my analyzed data from json and here is the code for my custom list field
    data analyzed.
    I have THREE channels of json and I want to show content tittle and date in the list filed. I'll post the screenshot of my list.

    JSONArray jsnarry = new JSONArray(responce);
                System.out.println("\n--length----- "+jsnarry.length());
                //System.out.println("....................................................=");
                for (int i = 0; i < jsnarry.length(); i++){
    
                    JSONArray inerarray = jsnarry.getJSONArray(i);
                        //System.out.println("\n-inerarray-values----- "+inerarray.getString(i1));
                        String TITTLE = inerarray.getString(1);
                        String CONTENT = inerarray.getString(2);
                        String DATE = inerarray.getString(3);
                                                           System.out.println("TITTLE= "+TITTLE);
                        System.out.println("CONTENT= "+CONTENT);
                        System.out.println("DATE= "+DATE);
    
    }
    

    output

    [0.0] --length----- 2
    [0.0]
    [0.0] -innerarray-length----- 6
    
    [0.0] TITTLE= BJP State President Sanjay Tandon's visit to Amita Shukla's Home
    [0.0] CONTENT=  BJP President Chandigarh Sanjay Tandon at Amita Shukla's Home
    [0.0] DATE= 2013-01-04
    [0.0] ................................................
    [0.0] TITTLE= Sanjay Tandon at mahasamadhi of Satya Shri Sai baba.
    [0.0] CONTENT= BJP Chandigarh President, Sanjay Tandon mahasmadhi of Sri Satya Sai Baba.(Andhra Pradesh)
    [0.0] DATE= 2013-01-13
    

    and my custom list field

           super(NO_VERTICAL_SCROLL);
    
             String TITTLE="TITTLE";
             String CONTENT = "CONTENT";
             String DATE = "DATE";
    
             v.addElement(new ListRander(listThumb, TITTLE, CONTENT,DATE, navBar));
    
             myListView = new CustomListField(v){
    
                 protected boolean navigationClick(int status, int time) {
                     //Dialog.alert(" time in milisec :" + time);
                     return true;
                 }
             };
    

    CustomListField.java

    public class CustomListField extends ListField implements ListFieldCallback {
    
        private Vector _listData;
        private int _MAX_ROW_HEIGHT = 100;
    
        public CustomListField (Vector data) {
    
            _listData = data;
            setSize(_listData.size());
            setSearchable(true);
            setCallback(this);
            setRowHeight(_MAX_ROW_HEIGHT);
    
        }
    
        public int moveFocus (int amount, int status, int time) {
    
            this.invalidate(this.getSelectedIndex());
            return super.moveFocus(amount, status, time);
    
        }
    
        public void onFocus (int direction) {
    
            super.onFocus(direction);
    
        }
    
        protected void onUnFocus () {
    
            this.invalidate(this.getSelectedIndex());
    
        }
    
        public void refresh () {
    
            this.getManager().invalidate();
    
        }
    
        public void drawListRow (ListField listField, Graphics graphics, int index, int y, int w) {
    
            ListRander listRander = (ListRander)_listData.elementAt(index);
            graphics.setGlobalAlpha(255);
            graphics.setFont(Font.getDefault().getFontFamily().getFont(Font.PLAIN, 24));
            final int margin =5;
    
            final Bitmap thumb= listRander.getListThumb();
            final String listHeading = listRander.getListTitle();
            final String listDesc= listRander.getListDesc();
            final String listDesc2= listRander.getListDesc2();
            final Bitmap nevBar = listRander.getNavBar();
    
            //list border
            graphics.setColor(Color.BLACK);
            graphics.drawRect(0, y, w, _MAX_ROW_HEIGHT);
    
            graphics.drawBitmap(margin, y+margin+10, thumb.getWidth(), thumb.getHeight(), thumb, 0, 0);
    
            graphics.drawText(listHeading, 3*margin+thumb.getWidth(), y+margin);
            graphics.setColor(Color.BLACK);
    
            graphics.drawText(listDesc, 3*margin+thumb.getWidth(), y+ margin+30);
            graphics.drawText(listDesc2, 3*margin+thumb.getWidth(), y+ margin+60);
    
        }
    
        public Object get(ListField listField, int index) {
    
            String rowString = (String) _listData.elementAt(index);
            return rowString;
    
        }
    
        public int indexOfList (ListField listField, String prefix, int start) {
    
            for (Enumeration e = _listData.elements(); e.hasMoreElements(); ) {
    
                String rowString = (String) e.nextElement();
                if (rowString.startsWith(prefix)) {
    
                    return _listData.indexOf(rowString);
    
                }
    
            }
    
            return 0;
    
        }
    
        public int getPreferredWidth(ListField listField) {
    
            return 3 * listField.getRowHeight();
    
        }
    
    }
    

    Listrander.Java

    public class ListRander {}

    private bitmap listThumb = null;
    incognito bar Bitmap = null;
    private String listTitle = null;
    private String listDesc = null;
    private String listDesc2 = null;

    public ListRander (Bitmap listThumb, String listTitle, String listDesc, String listDesc2, Bitmap navBar) {}
    this.listDesc = listDesc;
    this.listDesc2 = listDesc2;
    this.listThumb = listThumb;
    this.listTitle = listTitle;
    this.navBar = bar navigation;
    }
    public getListThumb() {Bitmap image
    Return listThumb;
    }
    {} public void setListThumb (listThumb Bitmap)
    this.listThumb = listThumb;
    }
    public getNavBar() {Bitmap image
    return the navigation bar;
    }
    {} public void setNavBar (navigation bar of the Bitmap)
    this.navBar = bar navigation;
    }
    public String getListTitle() {}
    Return listTitle;
    }
    {} public void setListTitle (String listTitle)
    this.listTitle = listTitle;
    }
    public String getListDesc() {}
    Return listDesc;
    }
    {} public void setListDesc (String listDesc)
    this.listDesc = listDesc;
    }
    public String getListDesc2() {}
    Return listDesc2;
    }
    public void setListDesc2 (String listDesc2) {}
    this.listDesc2 = listDesc2;
    }
    }

    You seem to have two problems here and are confusing them.  You must break the problem into two parts

    (1) extract the data from the entry and create the objects you want to display

    2) display in a list, a set of objects.

    Let's get the sorted first premiera.

    I will suggest what to do here, but in practice, you might actually think about this yourself as part of the design phase of your application.  You should do this, not me, because then you will have all the information available.  At the present time, I have just what you said, which is not much.  So maybe what I'm telling you is not correct for your application.  Only you can decide that.  And be blunt here, you should have decided this before you start coding.  Do you want you could lead down the wrong path.  You must think of your application as a home - as the architect must design all the rooms, and how they will be built, before you start building the House.  You do not, then we are building the rooms on the fly.  Who knows if they will be fit at home?

    In this case, I think you need to create an object that represents each of the elements in the internal array of new data.  call this object

    NewsItem

    This object will have attributes, such as its title, content, date, the linked image and so on, each of whom have will get and set methods.  While you treat each inner element fetch you the associated entry and update the object.

    When you have finished the inner loop of processing, you now have a complete

    NewsItem

    Object, so you will add it to a collection, an array of NewsItem objects, call this _newsItems.  You will create it at the beginning - you know how many entries it takes because it is the number of entries in your outdoor table.

    So before you start to deal with JSON, create your table and the 'index' value of 0.

    Once you have created your Newsitem, add this in the table to the position 'index' and increment "index".

    And once you have analyzed all the JSON, you will have a complete picture.  This is part 1 finished!

    And note in your drawListRow, you are given a clue - that is the index in your tables in _newsItems.  So you can easily find which entry to view and display it correctly.  But it is part 2 and is a separate issue.

  • How do you return a blank in table 2, when there is no data in the cell related in table 1?

    I run a recreational League of golf and have been recording the scores of the players (50 + players in total) with the intention of maintaining a form of disability from the League.

    So far, I did most of the calculations manually in number. Recently, I have experimented using the Lookup function but have encountered a problem with the time where the player does not play this week.

    In table 1, where I do all scores record cel when they do not play is left blank. However, in table 2 than corresponding cel returns a 0... strikes completely out of whack handicaps.

    Here is what I used in table 2 for the information of table 1...  SEARCH (name, 2016 Stats::Table 1 $Last: $ name, 2016 Stats::Table 1::G44)

    I also tried to add an IF statement, but I have obviously not understood correctly as he said I tried to refer to a cel in the statement itself.

    Example of the disability Page in the table 2 list a 0 is returned in cel 6... which is then averaged in the cel of last second... namely the problem. The cel with the 6 in it is a formula that counts the number of moves played and see it 6 because it counts as a trick played 0. This shows the wrong average score of 65.666

    Them

    A

    78

    1

    78

    Me

    Me

    80

    75

    81

    0

    81

    77

    6

    65.6666666666667

    -10

    As it appears in table 1. indicating the total number of rounds played in 5 and returning the precise average score of 78.8

    Me

    Me

    80

    75

    81

    81

    77

    5

    78.8

    Hi pondball,

    (Could be my 'golf name' somedays)

    Formula in Handicap::B2 and filled to the bottom and right at Handicap::X4

    = IF (LOOKUP ($A, data: $A, Data::B)=0,"",LOOKUP($A,Data::$A,Data::B))))

    IF compared the results of the first SEARCH and if it is zero, returns an empty string. If the comparison returns FALSE, the second SEARCH is called, find and returns the result of zero. AVERAGE does not take into account all results of text, including the string NULL, a zero-length text value.

    COUNT (used in the column count the number of turns) also ignores the text values.

    4th place of disability shows one of the reasons for not using LOOKUP.

    SEARCH alwas accepts a "close fit" with the search value. 'near match' for RESEARCH is defined as 'the largest value equal or less than the value of the research', and for the values text, "less than or equal" can be described as "identical or come forward in a list of items of text in alphabetical order.»

    For us, the other two values in the name list are 'less' us and the most important is 'Them', the values for 'Them' are returned.

    For this reason, I tend to use VLOOKUP instead of RESEARCH in many cases.

    VLOOKUP present the disadvantage of requiring her research-where location which will be the first column of the lookup table (which is not a problem here, because the location of the research is one ot the column data table).

    But also has the advantage of af being able to require an "exact match" search value.

    Here's the same tables of two, with VLOOKUP replacing LOOKUP. Note that the VLOOKUP function has a different syntax than the LOOKUP function.

    Formula VLOOKUP in Handicap::B2, filled with verse down and right at Handicap::X4:

    = IF (VLOOKUP ($A, Data: $A:$ X, COLUMN (), FALSE) = 0,"", VLOOKUP ($A, Data: $A:$ X, COLUMN (), FALSE) ")

    Written as above, the formula works correctly in rows 2 and 3, but will just return the error in the 4th row triangles, since it will not find a match (exact n) for 'Us' in column A of data.

    After confirming that it produces no unexpected error, wrap the formula in function SIERREUR as shown below and repeat the filling down and the right filling operations above.

    SIERREUR function interrupt all errors, including those affecting the results without your knowledge if they occur. Always delay adding IFERROR until you know what are the errors he fools.

    =IFERROR (IF (VLOOKUP ($A, data: $A:$ X, COLUMN (), FALSE) = 0,' ", VLOOKUP ($A, data: $A:$ X, COLUMN (), F ALSE))," ")

    Y2: = COUNT (C2:X 2)

    Z2: = AVERAGE(C2:X2) (base form)

    Z2: = IF (Y = 0,' ", AVERAGE (C2:X 2)) (real form)

    The encapsulation of the AVERAGE function in the IF statement deletes the calculation if the number of items to the average value is zero, AVERAGE preventing from return to a division by zero error. The number of circles in the column there is NOT used in the calculation of the average (AVERAGE did his own count), but is used as a switch 'OK to calculate' leaving the calculation of the AVERAGE to move forward.

    Kind regards

    Barry

  • How to get data in the procedure after CREATE TABLE table1 AS SELECT * from table2

    Hello

    can any body tell me how to get the data in the new table created in the procedure. because it gives following error.

    • Error (47,21): PL/SQL: ORA-00942: table or view does not exist

    tableName: = "BCKUP_" | TO_CHAR (sysdate, 'ddmmrrrr');

    tableDDL: = 'CREATE TABLE' | tableName. "AS SELECT * FROM Table1 where to_char(MSG_IN_TIME,''dd-mon-rrrr'') < sysdate - ' | daysNumber;

    EXECUTE IMMEDIATE backUpDDL;

    COMMIT;

    DELETE FROM Table1;

    How to select the data in the newly created table. as...

    Select * from ". tableName;

    Do not choose anything to get the number...

    Just after backupDDL EXECUTE IMMEDIATE, simply refers to SQL % ROWCOUNT - who will be the number of lines.

    Oh and DDL engages automatically, your commitment is redundant.

  • How to execute a Perl script and returns the value as a string?

    Hi, I am trying to build an application using the eclipse 2.0.0 with the Blackberry SDK 7.1 plug-in. currently I tested Simulator 9900 version 7.1.0.523. I need to use the Perl language to access the raw biological database and returns as a string without having to write a longer program using java.

    In a stand alone Java SDK, I can use the line:

    Process p = Runtime.getRuntime () .exec ("perl script.pl")

    but when I tried to use it on the IDE for a Blackberry project, the project will not compile. It is said:

    Method exec (String) is undefined for the type of Runtime

    Hopes, can someone show me the correct syntex to use, but if no class is available, could someone show me a sample for unified research process? The names of blackberry dev is very complicated, I can't find any samples for her.

    Thank you.

    Seems interesting.

    Your idea was to download the data to the BlackBerry and then directly execute queries.

    Although there are a number of other obstacles, the first fall you in East platforms supporting Perl.  Here is the list:

    http://perldoc.Perl.org/perlport.html#supported-platforms

    BlackBerry OS Java is not included - in fact the only ' included phone OS is Symbian.  Interestingly, it seems likely that PlayBook and BB10, because they are based on the QNX operating system.

    If we discard Perl as a query language, then you will need to provide another option to search.  I think that unified search is an option, but you will have some work to do to use it.  The first thing you should do is find out if in fact, you can download the database on the BlackBerry.  The only available on the Blackberry database engine's SQL, so if you want the database can be exported to a SQL database, there is a chance that it would work.  I had a quick glance around the site, and I can't tell what the "database" is in the format.  Then I suggest that look you at that next.

    I hope this helps.

  • How to find all photos in Lightroom where the original file is not found?

    Greetings

    I know there are a lot of pictures in my library in Lightroom where the original file is not found. How can I find all the photos for which this is the case? In other words, I see the exclamation point error in the upper right part of some photos and I would like to find all photos that have this condition so that I can link them to the originals.

    Thank you

    John

    In the library Module, chose the menu library/search all missing Photos

  • How to NOT send some form data when the form is submitted

    Hello

    I created a PDF form with radio buttons in the Group and the boxes. When I the form of data, such as values using the submit by e-mail button to send form data as XML or merge data into a spreadsheet files, I'll see the data values for radio buttons and checkboxes.

    What I want here is to don't get the data values for some controls such as the boxes option, but no other controls like check boxes, in the XML or Excel worksheet after submission of the form. I know how to hide the controls in the form, but I have to the visible and active boxes on the form.

    Is there a way to hide or do not send form data when the form data is submitted?

    Thank you

    Sam

    Hi Kyle,.

    That's exactly what I want! Once I have not selected any data binding, the field is in shape and active, but when submitted as XML or it merge with a spreadsheet, the field is gone.

    Forgive me if I didn't my self clear in my question. Answer you is straight to the point.

    Thank you very much!

    Sam

  • How to handle multiple formats of date to the same date field in SQL * Loader

    Dear all,

    I have a requirement where I need to get data from a text file and even insert into the oracle table.

    I'm using SQL * Loader to fill data from the text file in my table.

    The file has an area where I expect to date data date in different formats, such as MON/dd/yyyy mon/dd/yyyy mon/dd/yyyy, dd/mm/yyyy, DD/month/yyyy.

    When you use SQL * Loader, I can see loading fails for records where we have formats such as LUN/jj/aaaa, Mon/dd/yyyy, DD/month/yyyy.

    Is it possible in SQL * Loader where we can mention all these date formats so that data from that date should go smoothly in the underlying date column in the table.

    Receive your answer on that.

    Thank you
    Madhu K.

    I think following could be the solution to your problem:

    Suppose if you have data from four different date formats, you need to load the data into four different tables by running SQL * Loader four times and each time specify other date format in the control file whose data to load, and then at the end, merge data from these four different tables using the UNION clause.

    Elya

Maybe you are looking for