Pricing Blog

Checkbox value not sending in POST request to Xano

  • sally_51110-1372008640365461665

    Salutina

    2 months ago

    Hey everyone! I’m new to Toddle and could use some help with an issue I’m having sending a checkbox input to Xano via a POST API. Everything else in my form is working fine — all other inputs are passing through to Xano — except for the checkbox. I’ve tried a bunch of things, but can’t seem to get it to work. Here’s what’s happening: If I manually update the initial value of the checkbox variable (e.g. in the variable panel) and run the API, it works — the value is sent to Xano correctly. But when I use the actual checkbox input in the form and check/uncheck it, the value doesn't get passed through to Xano. Sometimes the value becomes undefined or gets sent as a string instead of a boolean.

    I've added photos of my set-up. Any help would be so appreciated!
    1372008646975684639-Variable_.png
    1372008647650971728-API-Body.png
    1372008648339095602-Form_submit_event.png
    1372008645516202014-Input_attribute.png
    1372008648728907776-Input_event.png
    1372008648024526918-Form_submit_success_event.png
  • paspom-1372104095569149973

    Pascal

    2 months ago

    hey, the event value might not give you the value you wished for – mind you flipping the boolean with a "not" formula?
    1372104095447646248-Bildschirmfoto_2025-05-14_um_08.49.24.png
  • sally_51110-1372746730847600763

    Salutina

    2 months ago

    That seemed to work! Thank you!!
  • sally_51110-1372844867033632800

    Salutina

    2 months ago

    Hey @Pascal - I have another related question for you. I'm now trying to calculate whether someone is over 18 based on their date of birth and send that as a boolean value (over_18) in my API request. I’m not sure what I’m doing wrong (probably a few things haha), but this is the setup in the body of the API.
    1372844867108995143-Screenshot_2025-05-16_at_5.52.22_pm.png
  • might this help?
  • sally_51110-1373825201984245840

    Salutina

    2 months ago

    That seemed to work! Thank you so much. I don't completly understand it, but it seems like it's mainly about making sure the date inputs are all formatted correctly? Thank you so mcuh for your help!
  • Tod-1373825204307886080

    Tod

    2 months ago

    Great job @Salutina! Your contribution to the Nordcraft Community just made you advance to Community Level 1! 🌲
  • sally_51110-1373909422782550067

    Salutina

    2 months ago

    Hi @Pascal - another form question. I’m now trying to submit a POST API request to update the existing data. I’ve set up a variable called 'selected Item'. Everything is working in terms of displaying the current data — each input field shows the correct value by binding the input’s value attribute to the appropriate property on selectedItem.

    However, when a user edits the input and submits the form/API request, the updated data isn’t being sent — only the original values are. It seems like the edited input isn’t updating the object variable. I've read about the two-way binding, but not sure how to do this? I understand I might need to use an input event to manually update selectedItem, but I’m not sure what the event should do? Do I need to create new variables for the edited form fields?

    Could you clarify how I should handle this? Added screenshots, the big formula is on my body. Thanks!
    1373909421352030228-Screenshot_2025-05-19_at_4.16.38_pm.png
    1373909422128103454-Screenshot_2025-05-19_at_4.16.04_pm.png
    1373909422488948786-Screenshot_2025-05-19_at_4.15.35_pm.png
    1373909422874689616-Screenshot_2025-05-19_at_4.14.25_pm.png
  • paspom-1373920208023982140

    Pascal

    2 months ago

    as far as I can understand you want to edit each item-field after selecting the item – then submitting the changes?
    You need, to do this, replace with the input value the item's field
    you do this with on-input -> SET formula -> then submit with that change
    if you're still stuck, feel free to dm me – we can do a quick call to let me explain you how to do that in a more thorough way, for free of course
  • sally_51110-1373941441654554696

    Salutina

    2 months ago

    That worked!!!! Thank you. I'm so grateful. For context, I have a web-app I want to build, and it uses lots of forms, so I'm testing the product to make sure I can build all the functionality I need first. So is this setup the best way to edit fields, using the set fomula?
  • paspom-1373943352537649244

    Pascal

    2 months ago

    no actually not haha
    well it depende – in general you use a PATCH method to directly perorm requests with the backend to edit a specific field
  • sally_51110-1373944072141541376

    Salutina

    2 months ago

    Haha. I thought it was meant to be PATCH, but my Xano was set to POST and I didn't stop to think that would be wrong (I set up the Xano yonks ago). Okay. I'll try again wiht PATCH!! Thank you. If I get into trouble, should I keep posting here or DM you?
  • paspom-1373945487077675098

    Pascal

    2 months ago

    good luck! dont forget to change the schema to field and value only
    It depends – in my experience, a quick call saves us both more time and achieves more – I'm curious what other people are building and you get some solved problem out of it
  • sally_51110-1373948225165197393

    Salutina

    2 months ago

    Thanks. Okay, I'll give it a go and if I get stuck I'll DM you and maybe we can have a quick call. Thanks so much for your help so far - life saver 🙂