Set add/edit record metadata item to optional
Options
espptyltd
Member ✭
Is it possible in an add or edit record database request to set specific metadata fields ( the mapping of the input to the database field ) to be optional, so that if the calling system does not pass that specific key through, the request will just ignore it?
I've tried using first_notempty for this purpose (as per screenshot), however Xano still requires that all var's mentioned in the metadata mapping exist otherwise an error will be thrown. [MetadataMapping.png]The payload from my calling system will differ from call to call, but I still want to map an input if it does exist to a field in the database, so I can't take it out.
Thanks for any advice.
I've tried using first_notempty for this purpose (as per screenshot), however Xano still requires that all var's mentioned in the metadata mapping exist otherwise an error will be thrown. [MetadataMapping.png]The payload from my calling system will differ from call to call, but I still want to map an input if it does exist to a field in the database, so I can't take it out.
Thanks for any advice.
Comments
-
I think you are looking to use the output field with a "get" filter, rather than using the dot notation. The "path" would be "department" and the "default" would be "project2.department."
-
Worked perfectly! Thanks for the response.
For reference for others, here's my final config ( field name changed from original post from department -> cf_1[image.png]
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