I have a firebase query, which includes a timestamp check. I want to be able to run this query in my retool workflows as I do in my retool apps
I think the issue is retool has different parsing of parameter input in apps and workflows, I can put {{new Date()}} in a where clause in any app, it will throw error in GUI saying it expects string, but it will work fine. We can see the date object in the preview section for that input.
But in the workflow, it will show null instead of the date object when we put {{new Date()}}. As a result, we are getting an empty value.
It doesn't even run an imported query with a timestamp check, which is very weird.
I tried different values as the timestamp value, moment(), firebase Timestamp, etc. doesn't work, because the workflow query field parses every date object into null
This query works in any App and in the Query Library
I don't now the reason but I'm not able to get the same result as you.
I can run a firebase query in Retool Apps, but same query isn't working in Retool Workflows. I think its about the Where value input is being override as null.
Left one is Retool Apps ------- Right one is Retool Workflows
However, the query should still run. Could we double check if maybe there is a space after the column name on the WF query block? For example, I experience the same with a space after created_at :
@Paulo I'm having the exact same issue here with querying Firestore with timestamp. I've tried with both moment() and new Date() and I'm getting the same results as @Sparkspark
Would appreciate your help with this. thank you in advance!
For additional reference, I've also tried using a code block as per the screenshot to reference the data from it over to the value field. Still no luck
Hi @Paulo Thanks for the warm welcome. please see the attached for the screenshot of the resource query block. As you can see there is nothing being returned when attempting to query documents with 'created_dt' field before "now". Appreciate your help. thank you.
@Paulo No luck. Nothing is being returned even when using an existing value. However, when querying a different field with a different value type, it queries without an issue. So I suspect there's a problem with timestamp/datetime formatting. Please refer to the screenshots.
From you last screenshot, I see that the value for created_dt has a mmm dd, yyyy format. Is it possible that this field is a string and not a Timestamp?
@Paulo You can see the issue in the outgoing request, Retool App and Retool Workflow sends different type of request for the exact same query. Retool Workflows request is not parsed correctly according to the firebase requirements.
I found this after we decided to use some other solution and I won't be repeating the issue to show some screenshots, but you can easily see the source of failure by looking at the requests in the networks tab in chrome.
Thanks for sharing the screenshot and additional context. No need to repeat the issue to show some screenshots but do you mind sharing what was the solution you found?