I’m new to Weweb and the terminology, not a programmer, I managed to learn it pretty quick anyway , I am struggling trying to filter a collection by date, where the date field is returned from another table (Addon in Xano API), I cannot reach the date field in the filter section, as I can only access the entire object (returned by the addon). I’d appreciate your help,
This is the Xano API result, you can see the Addon that includes the date highlighted:
I’m looking for a solution to this too.
I asume that a way is to create a column in the table that shows the date (so you bring this data to the surface) to filter, but not sure if this is the best way to do it.
// Access the global variable containing the data
const items = collections['c0876745-e0f1....de439c6947c9']['data']['items'];
// Get the current timestamp
const currentTime = Date.now();
// Calculate the timestamp for 2 days ago
const twoDaysAgo = currentTime - 2 * 24 * 60 * 60 * 1000;
// Filter the items based on the 'last_active' property
const filteredItems = items.filter(item => {
// Check if 'last_active' property exists and if it's greater than 2 days ago
return item._content_of_user.last_active && twoDaysAgo > item._content_of_user.last_active;
});
// Return the filtered items
return filteredItems;
The other method is to add the property as an Eval in Xano.
Hi @Quentin, just finding this thread as I’m running into the same issue. Did this feature get added? Still seem to be unable to access nested objects.