Hello, I guess it's a very dumb question but what do I missing ??
I have a cloud function returning this output (as seen in the consol of my browser) :
{
"result": [
{
"brand": "Car1",
"model": "ModelA",
"price": "80000",
"cardID": "abc123",
"collectionParent": "cars"
},
{
"name": "Artwork1",
"price": "35000 USD",
"autor": "Artist1",
"cardID": "def456",
"collectionParent": "arts"
},
{
"model": "Aircraft1",
"price": "20000000",
"range": "3000 NM",
"cardID": "ghi789",
"collectionParent": "airs"
}
]
}
the return of my funciton is clearly :
return finalDocs;
So the "result" comes from the cloud funciton i guess, not in my code.
And in my flutterflow, i put this output in an app state => list json.
and the json path is just "$" :
I guess since there is only result that goes directly in ? maybe but this is working.
Then I wanted to upgrade my function (just want to add pagination) so i need 2 output
so the return of my function is :
return {
documents: finalDocs, // This will contain the actual list of documents
paginationData: { // Placeholder data for pagination testing
lastDoc: {
id: "randomDocID123",
timestamp: Date.now() // Random data, e.g., a timestamp for this example
}
}
};
and in the console the output is something like that :
{
"result": {
"documents": [
{
"brand": "Car1",
"model": "ModelA",
"price": "70000",
"cardID": "abc123",
"collectionParent": "cars"
},
{
"model": "Aircraft1",
"price": "23000000",
"cardID": "def456",
"collectionParent": "airs"
},
{
"capacity": 12,
"range": "2400 NM",
"cardID": "ghi789",
"collectionParent": "airs"
}
],
"paginationData": {
"lastDoc": {
"id": "randomDocID123",
"timestamp": 1731576970895
}
}
}
}
So now in the json path i tried :
$
$.documents
$.documents[*]
$.result.documents
$.result.documents[*]
with my first output i also tried $.result or $.result[*] nothing is working except the "$" alone....
When i try all those json path in https://jsonpath.com many of them are working... but in flutterflow, it's always empty π
Do you have any idea ? do i miss something ? is it because my app state is a list of json ? but if I take only $.result.documents the output is a list of json... I think... right ?