xdo error
Hi, not sure whats wrong with a pretty simple query all records:
I am trying to query records based on record.user_id = auth: id AND record.expiration > now
I get an error: Unsupported parameter reference - xdo
Here is the link:
Thanks!
Answers
-
@RS63 that link works only for you. Better post some screenshots.
-
hey, hoping admins can access and take a look. its literally just the query with two conditions I wrote. Used the exact same one in diff apis, but not working in this one… @Michael Udinski
-
Unsupported parameter reference - xdo sometimes happens when the type set in a UI input box is incorrect. Check if the correct type should be INPUT, VAR, or TEXT (or other type) in all input boxes of your query conditions.
-
Hi @RS63
We don't have access to the link to your endpoint either. If you can provide screenshots of your function stack, we will be able to help you.
Is the "record.expiration" field a date or a timestamp type? -
Here it is. expiration is a timestamp. Its weird, bc i literally use the exact same function in a diff api w no problem.
Here is the table:
Here is the api / function
Here are the conditions
And here is the error
-
@RS63 all seems to be correct. I've tested your case, and works well without issues on my side. Have you tried to rewrite the WHERE clause and save the Query All Records function that throws the error, or even delete the Query All Records function and create a new one again? Sometimes Xano cannot update well all parameter references in the function stack if you change their type in the database structure.
-
Hi, thank you for checking. I deleted the API endpoint, created the new one with the exactly same as above and it's the same error, unfortunately. Any chance someone can look under the hood? I don't want to mess with the table itself, as a lot of other work is successfully tied to it.
-
Ok, all, i was able to make it work. Basically had to go step by step and run it after each one:
Add Query all records with nothing else - run - works
Add auth to endpoint - run - works
Add condition for user.id = auth: id - works…
… - works
If i try to rebuild the whole thing at once, even with a fresh endpoint, it throws an error. Good enough for now, as a workaround, if I encounter this in the future, but just fyi.
-
And one more piece of info - it breaks as soon as I change the output from List to Single.
-
@RS63 I've tested again with a single output and still works well on y side. There must be something else we are missing.
NOTE: I'm using the < operator rather than the > operator because my timestamps are all past dates. If I use > the single query result is null, obviously, but nothing breaks.
One more suggestion: Create another Xano account and replicate exactly the same scenario in the new account to make sure the issue only affects to your current account.
-
OMG i just had the biggest facepalm moment this Saturday evening. cant believe i spent all this time with this bug I MYSELF introduced. So here is what happened:
When i changed output to Single, i needed to add descending sorting to get the most recent record. But for whatever reason i never selected anything in the Sort By dropdown.😫
One recommendation for Xano - don't allow to Save, if a Sort By is not selected when enabling sorting…
Thank you, @arturosanz , for helping me open my eyes here.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback