Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo Plugins Support › Trouble with calling multiple items from one query in Firebase

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20272

    Edward

    Hello!

    I am able to read multiple values from a single firebase database path, and I need to place this information into a combobox,

    currently when reading a single entry from the database I can add this to my combo box by the following;

                firebaseDb.getValue("public/listEntries/title1",
                                    {}, function(success, key, value) {
                                        if(success) {
                                            myArray.push(value); combobox.model = myArray
                                        }
                                    })

     

     

    when I try to push the queried information to my combobox using the above method I receive the following information in my log;

    file:MyDiary//qml/Main.qml:260: Unable to assign QJSValue to QString

     

    line 260 of my code is

                            text: modelData

    which links to my combobox model:

                        model: myArray [""]

     

     

    what could be amended to handle this?

    my query code is below;

     

                firebaseDb.getValue("public/bigqueryobject", {
                                        orderByKey: true,
                                        startAt: 0,
                                        endAt: 1000,
                                        limitToFirst: 5
                                    }, function(success, key, value) {
                                        if(success) {
                                            console.debug("Read value for key ", key, "fromFBDB: ", value);
                                            myArray.push(value); combobox.model = myArray
                                        }
                                    })

     

     

    Thanks

     

     

    #20276

    Edward

    ****update****

     

    Ive figured it out!! So i read elsewhere to change to an array, but removing the array and just using

    combobox.model = (value) 

    Worked fine, also with the query i removed startAt, endAt as it was displaying the titles by their key, not the values alphabetically, so just orderByValue with no other filtering worked

     

    Then to further add the selected title to my UID in firebase i did the following (this works but need to develop further as it needs to use this to assign users to groups so if i would go a different way about it let me know!!)

    firebaseDb.setUserValue(combobox.selectedText, “true”)

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded