Create_object filter no returning entry from a null value.
I have two lists, key_list
= ["a", "b", "c"], values_list
= [1,2,null]. The create_object filter will return
{"a":1, "b":2}, the entry with null will not be included. What can I do to ensure I return {"a":1, "b":2, "c":null}?
Comments
-
Hi @Alimama ! 👋
The create_object filter doesn't currently handle the null value. This is an issue that we are currently tracking. In the meantime, if you know precisely which key in the object you want the value to be null, you can update the variable and set that specific key to null.
Here is an example of how to do this:Otherwise, if you expect your data to look different every time this function runs, and you don't know which property will contain the value null, you can implement something like this:
Let me know if this is helpful! 😊
-
Hi @lizanaya.
Thanks so much for helping out. This helps to solve the problem! 👍️
-
Awesome, @Alimama ! 🎉 Glad to hear the workaround solved the problem!
-
Hi @lizanaya
Once more, many thanks!
In your example, you used
key_list
= ["a", "b", "c"],values_list
= [1,2,0], what if thevalues_list
= [1,2,null]? I think it still gives {"a":1, "b":2}, instead of {"a":1, "b":2, "c":null}. The aim is to ensure it returns {"a":1, "b":2, "c":null}, it should simply return all values, null or not. Any chance you can help with this? -
@Alimama
First of all, thank you so much for bringing this to our attention last week! We've looked into it and found the bug, and the fix will be included in our upcoming release later this week. We'll make sure to keep you updated by announcing the release here in our community so you know when this is up and working. 😊 -
Hi @Alimama !
Wanted to give you an update and let you know that a solution is now available to have null values persist when creating an object. Check out this video with the solution, and let me know if it's helpful. 😄
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