Table Ref
Options
![Per Thiessen](https://us.v-cdn.net/6037124/user_avatars/3978887.jpg)
Per Thiessen
Member ✭
Hi,
I am having a table ref from an entries table linking to a currency table, and when I run the query I get the following error message Invalid cast: "("merchant_transactions"."xdo"->>'currency_iso4217_id')::bigint" is of type:"tableref", but trying to be of type:"json"
[Screenshot 2022-08-29 at 10.31.39.png][Screenshot 2022-08-29 at 10.33.05.png][Screenshot 2022-08-29 at 10.33.44.png][Screenshot 2022-08-29 at 10.34.29.png]
When I check the decoder it finds the correct ID and everything for the currency, but it is somehow not parsing the result into the last of my function stack[Screenshot 2022-08-29 at 10.34.29.png]Hope someone can help getting the right info
I am having a table ref from an entries table linking to a currency table, and when I run the query I get the following error message Invalid cast: "("merchant_transactions"."xdo"->>'currency_iso4217_id')::bigint" is of type:"tableref", but trying to be of type:"json"
[Screenshot 2022-08-29 at 10.31.39.png][Screenshot 2022-08-29 at 10.33.05.png][Screenshot 2022-08-29 at 10.33.44.png][Screenshot 2022-08-29 at 10.34.29.png]
When I check the decoder it finds the correct ID and everything for the currency, but it is somehow not parsing the result into the last of my function stack[Screenshot 2022-08-29 at 10.34.29.png]Hope someone can help getting the right info
Comments
-
it sounds like you might be passing a JSON object as your var: currency value. Since db:merchant_transactions.currency_iso4217_id is a table reference (meaning it's an integer) you will be required to compare an integer to integer. So you'll want to make sure var: currency is only an integer value of the id you wish to grab. One trick to figure out what is in that variable is to implement the stop&debug just after the creation of var:currency and return the value.
-
Hi Michael,
Thanks for the solution on this, it makes perfect sense now!
Per
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