xdo error

Options

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:

https://x8ki-letl-twmt.n7.xano.io/workspace/47057-0/api/142002/query/1410445

Thanks!

Answers

  • arturosanz
    arturosanz Member ✭✭
    Options

    @RS63 that link works only for you. Better post some screenshots.

  • RS63
    RS63 Member
    Options

    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

  • arturosanz
    arturosanz Member ✭✭
    Options

    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.

  • Louis Machado - CSA
    Louis Machado - CSA Administrator

    ADMIN

    edited October 2023
    Options

    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?

  • RS63
    RS63 Member
    Options

    @Louis Machado - CSA

    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

  • arturosanz
    arturosanz Member ✭✭
    edited October 2023
    Options

    @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.

  • RS63
    RS63 Member
    Options

    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.

  • RS63
    RS63 Member
    Options

    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.

  • RS63
    RS63 Member
    Options

    And one more piece of info - it breaks as soon as I change the output from List to Single.

  • arturosanz
    arturosanz Member ✭✭
    edited October 2023
    Options

    @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.

  • RS63
    RS63 Member
    Options

    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.