Querying based blank and null values and date values
Hi,
I have some different columns. Som of the are blank ("") and some of them are null.
I would like to make an api call (using http endpoint for each data table), where I e.g. can retrieve all records where x column is null or where y column is blank ("").
Also, I can't get querying based on dates both unix epoch format and standard yyyy-mm-dd format to work.
Does anyone of you know how to do that?
Answers
-
Hi N,
For your first question, In your configuration, you will need to make use of the "is_empty" filter. It will pick up on the different variations of an empty field.
For the second question, try using an if-condition and place your date-based queries in there and the date filters should show up.
Feel free to share a loom if you'd like a more in-depth solution.
-
Hi there,
Thank you.
- Okay, so I should creating a is_empty variable and then query those that is = true?
- I am working in python - do you have a have script example?
This doesn't work..
2.a. how can I request records on a specfic date2.b. how can I request records after or before a specific date?
-
Hi N
So for the first question, here's how I implemented this logic on my side.
Step 1: Created a variable called "list" that is an array
Step 2 : Queried the relevant table with no custom query defined
Step 3: Added a for each loop so I can go through each item in the response from Step 2
Step 4: Added an if condition that checks if the current item's token is empty (this is where you will specify the columns you want the conditions to check for. Instead of using " = null" or " = """, is_empty will check for any types of empty records so it is the safer option)
Step 5: If the condition comes through as true, I am then adding the item to our list from Step 1 using the "Add to end" option under Data Manipulation>Arrays.
Unfortunately I do not have a script you could use but I would recommend checking ChatGPT.
For your second question
You could pass a specific date as an input and inside the query, use that input to define your query.
If you would like to go over this on call, we have 2 free Office Hours sessions every Tuesday at 10am and 5pm PST where we go over any issues customers are facing and guide them through it.
Here's the link to sign up. Alternatively, if you still need some help, feel free to drop a loom here so I can give more detailed guidance.
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