Create record error 422

Hi,

I am trying to create a record, but am getting error 422. I have the fields included in my Airtable too.
Please see attached.![Screen Shot 2021-04-07 at 8.39.23 PM|690x431]

Hi,

In the API doc it says “objects should have one key fields which contains all of your record’s cell values by field name”, so all those 5 properties in your Create Record node should be within fields. Just edit the schema of your create record request :slight_smile:

fields {
    Brand:
    Quantity:
    Type:
    Cost:
    id:
}

Hi Cecilia,

I was able to create the object fields… Thanks :slight_smile:
But i am unable to store the quantity value in the backend…

I want to enter a quantity in my app and wish for that to get populated in the backend for the corresponding Brand and Type. My brand and type are getting stored but not the quantity…
Can you kindly assist?

Hmm the setup looks fine, a couple of things to check:

  • The variable Qty does get the correct value when something is types in the input, check with debugger
  • The data types match: input fields give out text type values, but if your data base want a number type value as quantity, you might have to set Quantity as STRING(Qty)

Hi Cecilia,

How and where can i change it to String(QTY) ?
Currently my input filed is getting stored as an app variable… and there is no provision to enter data type as String(QTY)… i tried storing as a page variable and binding it to the “save” button, but it still does not work.
Are you asking me to change the schema of the external data and field “Quantity” ? if yes, how and where can i enter the formula? Because i only see these options…

It would be great if you can kindly assist!

Hi Cecilia/AppGyver team,

Can you kindly assist?

@Mari @Mevi @Cecilia_Berg @Marko_Lehtimaki @Kimmo

Would really appreciate it if any of you can kindly provide some leads… really stuck at this point :frowning:

Hi,

Sorry for the delay! In the create record node, you’re using the object properties binding. When you click on that, you should be able to change the field Quantity’s binding to a formula, and set that as STRING(Qty), like this:

Hi Cecile,

I appreciate you getting back on this… But it still did not work and am getting the following error.

Again, the “QTY” in your STRING(Qty) formulae, which of the following does it represent ?

  1. The quantity field in the database , which is set to collection of record?
  2. Should another page or app variable be created to hold this “Qty” value ? and what data type must it be set in ?

    And should this be assigned to both the Input field button as well as the save button?

@Cecilia_Berg Can you please kindly clarify?

Oh no I have misspoken, I meant wrapping it in a NUMBER() function, so sorry for the confusion! And I meant the variable that holds the Quantity value in the input, wrap that in a NUMBER() function in the Create Record properties. But this is only the case if the quantity property in your database is a number type. If this is not the case, then there’s some other issue. Just to clarify, here’s how this should be set up:

  1. You have a variable for the new record you are creating, either
    a) separate text type page variables for each field,
    b) an object type page variable with the same schema as the data record you are creating
    c) or a new type data variable
  2. All inputs are bound to its corresponding variable, created in the first step
  3. When clicking save, the Create Record is triggered, and using Object with properties you can individually bind each record property correctly.
    a) If your backend wants some property as a number type, wrap that variable in a NUMBER() formula function, since input fields only produce text types.