Skip to main content

BigCommerce form_fields mapping

Comments

2 comments

  • Permanently deleted user
    Celigo University Level 2: Seasoned
    Engaged

    As a sub-array.  It will be called form_fields on the customer record, but at the product/sales level, it will be product_options.  In that form_fields (or product options), you will have items in a subarray.  It is THOSE Items you are looking for.  Recommend transforming them to a higher level on the array before using them if possible.

    0
  • Peter Verrier Strategic Partner Channel Partner
    Celigo University Level 2: Seasoned

    Hi Todd, thanks for the details there. I had forgotten to specify I was looking at address form field through an order.

    What I ended up doing was playing around with the dev playground with the Handlebars editor for Nested JSON records. I exported the order via the BigCommerce API then pasted it in the "Resources available for your handlebars template".

    handle bar I made to get this result.

    {{#compare shipping_addresses_1.form_fields.0.value "==" "true"}}{{shipping_addresses_1.form_fields.0.value}}{{else}}{{billing_address.form_fields.0.value}}{{/compare}}

     

    Because the form field I'm looking for is binary, with only true or null, I can check that field for the value itself.

    I check the shipping and if it's not true, set the billing, as either are going to be true or not, so no need to check the billing form field too.

     

    I hope. This example helps someone, because I didn't find Anything anywhere about doing this but your tip actually gave me the idea to check via the playground.

    0

Please sign in to leave a comment.