0

So this is a very basic question but I've really hit a roadblock here. I've attempted quite a few things but I can't really understand how to extract the data from my parse table and get it into my app. I went through all the tutorials and still can't connect the dots.

What I'm trying to do is the following:

enter image description here

I want my app to be able to display every persons name who has a "human" designation. I've tried the following base code:

ParseQuery<ParseObject> query = ParseQuery.getQuery("PersonClass");
    query.whereEqualTo("PersonType","human");
    query.findInBackground(new FindCallback<ParseObject>() {
        public void done(List<ParseObject> personList, ParseException e) {
            if (e == null) {                  
               ***HERE IS WHERE I"M CONFUSED ABOUT HOW TO EXTRACT THE DATA!!!!**
            } else {

            }
        }
    });

So the results I WOULD LIKE to see would be a return of "Steve" and "Gary" as they are both human designations

Where do I input data to point it towards searching through the specific column of "PersonsName" and then once it is pointed in that direction, how would I extract that data from this?

2 Answers 2

1

Try this :

ParseQuery<ParseObject> query = ParseQuery.getQuery("PersonClass");
query.whereEqualTo("PersonType","human");
query.findInBackground(new FindCallback<ParseObject>() {

  @Override
  public void done(List<ParseObject> personList, ParseException e) {
    if (e == null) {    
        if(personList.size()>0 ){             
            for (ParseObject person : personList) {
                String pearsonName=person.getString("PersonsName");
             }
        }else{
             // No records found
        }
    } else {
      //Handle the exception
    }
  }
});
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you! That did indeed allow me to access that data! Much appreciated buddy!
1

do like this

get every Person object from list and get PearsonName from that Pearson object

ParseQuery<ParseObject> query = ParseQuery.getQuery("PersonClass");
query.whereEqualTo("PersonType","human");
query.findInBackground(new FindCallback<ParseObject>() {
    public void done(List<ParseObject> personList, ParseException e) {
        if (e == null && personList.size() > 0) {                  
            for (ParseObject person : personList) {
                String pearsonName=personList.getString("PearsonName");
            }
        } else {

        }
    }
});

1 Comment

I'm too late for answer.but if this helped than you can accept, so it's helpful for other stacky.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.