Skip to content
Back

Kotlin - Document payload missing when creating document with null values

  • 0
  • Self Hosted
  • Databases
jade
12 Jun, 2023, 03:43

I have a collection with two attributes, and when I create a document with the Kotlin SDK with both of them set to null, i get the error AppwriteException: The document payload is missing.

TL;DR
User is experiencing an issue with creating a document using the Kotlin SDK where both attribute values are null. They are receiving an error message stating that the document payload is missing. They are using Appwrite SDK version 2.0.0. Solution: None provided in the thread.
joeyouss
12 Jun, 2023, 04:25

Hi

joeyouss
12 Jun, 2023, 04:25

Can you show me the code you have been using to make the document? and also the version of Appwrite

jade
12 Jun, 2023, 08:33
TypeScript
val appwriteClient = Client()
    .setEndpoint(env("APPWRITE_ENDPOINT"))
    .setProject(env("APPWRITE_PROJECT_ID"))
    .setKey(env("APPWRITE_API_KEY"))

val databases = Databases(appwriteClient)

databases.createDocument(
    databaseId = env("APPWRITE_CONFIG_DATABASE_ID"),
    collectionId = env("APPWRITE_CONFIG_COLLECTION_ID"),
    documentId =  serverId.toString(),
        data = mapOf(
        "admin_alert_channel" to null,
        "admin_role_id" to null
    )
)
jade
12 Jun, 2023, 08:33

sorry i fell asleep lol

jade
12 Jun, 2023, 08:34

sdk version is 2.0.0

jade
12 Jun, 2023, 18:35

huh it's only when both values are null

jade
12 Jun, 2023, 18:36

if i set one to a random integer it works but when both are null, i get the error

jade
12 Jun, 2023, 18:36

is there any way i can fix this on my side or is it an appwrite thing?

joeyouss
12 Jun, 2023, 18:41

this is weird

jade
12 Jun, 2023, 18:41

i can agree with that lol

joeyouss
12 Jun, 2023, 18:48

ill check this and let you know once

jade
12 Jun, 2023, 18:49

tysm! do you have any estimate on how long that'll be?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more