Set add/edit record metadata item to optional

Options
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.

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    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."
  • espptyltd
    espptyltd Member
    Options
    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]