Optimized read JSON
Options
![Frank Wieffering](https://us.v-cdn.net/6037124/user_avatars/3712245.jpg)
Frank Wieffering
Member ✭
Hi,
Underneath a screenshot of a JSON message. The contactinfo may have an e-mai or telephone, but this optional.
I can loop through contactinfo and fill a variable with mailadres and telephone. After the loop I can add a record to my database and use this variable. I want to add a record with separate mail en telephone.
But this sounds like inefficient, but it works.
Can't this be done with filtering in the add record event?
[CleanShot 2022-08-28 at 12.23.36@2x.png]
Underneath a screenshot of a JSON message. The contactinfo may have an e-mai or telephone, but this optional.
I can loop through contactinfo and fill a variable with mailadres and telephone. After the loop I can add a record to my database and use this variable. I want to add a record with separate mail en telephone.
But this sounds like inefficient, but it works.
Can't this be done with filtering in the add record event?
[CleanShot 2022-08-28 at 12.23.36@2x.png]
Comments
-
Sounds like a good use case for the Array function "find first element". You just look for where $this.type is equal to the key you are looking for. (I tested and you can do this dynamically using the get filter too)
Note this is a function but not a filter. It adds one line to your function stack.
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