CHANGED TO BUG REPORT AS IT APPEARS IT’S A BUG WITH .where in PHP
I’m making a call to Google Photos to get a list of Albums. The Google Photos API has no way to filter this call so I need to filter the results in the server connect. In my case I want to filter it by the title starting with TT. I tried using api.data.albums.where(‘title’, ‘startsWith’, ‘TT’) as the Expression in a repeat but that throws an error: “message”: “Undefined index: title”. Same error happens if I try to Set Value as an array.
I can do the repeat on the full api data set and use a condition to set a value if the title starts with TT but then I end up with a dataset with lots of empty records. I can get around this by filtering on the client side but I’m wondering if there’s a way to do this server side. Also curious if there is a reason for the repeat to return empty records at all.
Unfortunately, I don’t know how to help further. At this point you’d have to stick with the Repeat that works, and if you have free time open a bug report about the .where formatter failing. I tested it here on latest NodeJS and it seems to be working fine
It seems to be duplicating the albums. I can’t select or delete that second set. And I get the same error using a subset of api.data or api.data.albums.
I also get the same error if I try to use where on the repeat.
Sorry - it joust looks different on your screenshot
If you use the 2 set values like I have posted above but disable the second (leaving just the one set to api.data.albums) what do you get in your browser console when it is output?
Actually yes. Interesting thought. In my condition to set value in the repeat I had to add title != null because it was adding the last title value to an album without a title.
Unfortunately going through and giving titles to the albums didn’t change the error.