Quote Start Date can't be found in Design Tools

nivg
Member

Hi all,

I have created a custom quote template via the design tools and trying to add the "start date" (an existing field when creating a quote) data in the quote's table of products.

I tried getting the relevant key-value combo from template_data.quote.line_items

but can't find it. just the "createdate" or "hs_createdate" keys.

I have been looking in all modules, htmls, and other code but found nothing. 

 

I'd appreciate any help tracking this data down.

 

Thanks in advance

0 Upvotes
3 Replies 3
Teun
Guide | Diamond Partner

Hi @nivg ,

 

Please try the following:

 

{% set TIMEZONE = template_data.quote.hs_timezone || 'US/Eastern' %}
{% set LOCALE = template_data.quote.hs_locale || 'en-US' %}

{{ template_data.quote.hs_createdate|int|datetimeformat('%B %e, %Y', TIMEZONE, LOCALE) }}

The above should work, but only on a published quote. If you try to preview this, it will show nothing. You could set some mock data to use.

 



Did my answer solve your issue? Help the community by marking it as the solution.
nivg
Member

Thank you for the quick reply!

doesn't hs_createdate represent the quote creation date? and not necessarily the product's  license "start date"?

 

0 Upvotes
Teun
Guide | Diamond Partner

@nivg ,

 

My bad! I think I read your question wrong. I'll share all mock data that is available in HubSpot below. If you check the lineitems, you see that each lineitem has a "createdate". So you might be able to use that. You can try the following:

{{template_data.quote.associated_objects.line_items[0].createdate}} to get the createdate of the first lineitem.

 

 

Mock data:

{
  "hubspot_base_url" : "https://api.hubapi.com",
  "is_preview": "true",
  "quote" : {
    "id": 1,
    "hubspot_owner_id": "1",
    "hs_all_owner_ids": "1",
    "hs_created_by_user_id": "1",
    "hs_updated_by_user_id": "1",
    "hs_lastmodifieddate": "1/1/20",
    "hubspot_owner_assigneddate": "1/1/20",
    "hs_createdate": "1577898314000",
    "hs_expiration_date": "1609434314000",
    "hs_title": "Sample quote",
    "hs_template_type": "QUOTE",
    "hs_proposal_domain": "1.hs-sites.com",
    "hs_proposal_slug": "sampleSlug",
    "hs_proposal_template_path": "cms-quotes-theme/minimal.html",
    "hs_quote_amount": "$100",
    "hs_timezone": "US/Eastern",
    "hs_currency": "USD",
    "hs_language": "en",
    "hs_locale": "en-us",
    "hs_public_url_key": "0123456789abcdef",
    "hs_terms": "<p>Sample terms</p>",
    "hs_comments": "<p>Sample comments</p>",
    "hs_logo_url": "https://static.hsappstatic.net/salesImages/static-1.362/avatars/default-company-avatar.png",
    "hs_status": "APPROVAL_NOT_NEEDED",
    "hs_primary_color": "#425b76",
    "hs_quote_number": "20200101-00000001",
    "hs_payment_enabled": true,
    "hs_esign_enabled": true,
    "hs_object_id": 12345,
    "hs_sender_company_name": "HubSpot",
    "hs_sender_company_address": "12345 Address Lane",
    "hs_sender_company_city": "Cambridge",
    "hs_sender_company_country": "United States",
    "hs_sender_company_image_url":"https://api.hubapiqa.com/avatars/v1/signed-uris/1CmcKFwgEEhNzbGVlcHlzaGVlcC53ZWJzaXRlGJmI4PYFIJyrMyoaYnJhbmRpbmc6YXBpOndlYjp1cy1lYXN0LTEyJjI2MDE6MTg0OjQwODA6NGZjMDpjY2VhOjc2NzA6NGQyMjphZjFhEhkA-NPq9tzonI3OpA087XM8Z2BgzO0mPYq6",
    "hs_sender_company_state": "MA",
    "hs_sender_company_zip": "02112",
    "hs_sender_email": "hubspot@hubspot.com",
    "hs_sender_jobtitle": "Marketing",
    "hs_sender_firstname": "Firstname",
    "hs_sender_lastname": "Lastname",
    "hs_sender_phone": "+11231453214",
    "hs_user_ids_of_all_owners": "12345",
    "associated_objects" : {
      "company": {
        "id": 1,
        "name": "Sample company",
        "address": "123 Sample Town",
        "domain": "example.website",
        "city": "San Francisco",
        "state": "California",
        "zip": "90000",
        "country": "United States"
      },
      "deal": {
        "id": "123",
        "hs_object_id": "123",
        "dealname": "Deal name",
        "dealstage": "appointmentscheduled",
        "createdate": "1600353202304",
        "pipeline": "default",
        "deal_currency_code": "USD",
        "hs_tcv": "1.0",
        "hs_mrr": "0.0",
        "hs_arr": "0.0",
        "hs_acv": "1.0",
        "amount": "100",
        "hs_forecast_amount": "100",
        "amount_in_home_currency": "100",
        "hs_deal_stage_probability": "0.2",
        "hs_projected_amount": "20.0",
        "hs_projected_amount_in_home_currency": "20.0",
        "closedate": "1601476402304",
        "days_to_close": "13",
        "hs_is_closed": "false",
        "hs_closed_amount": "0",
        "hs_closed_amount_in_home_currency": "0",
        "num_associated_contacts": "2",
        "num_notes": "5",
        "num_contacted_notes": "0",
        "notes_next_activity_date": "",
        "notes_last_updated": "1607004000000",
        "hs_analytics_source": "OFFLINE",
        "hs_analytics_source_data_1": "CONTACTS",
        "hs_analytics_source_data_2": "CRM_UI",
        "hs_created_by_user_id": "222",
        "hs_user_ids_of_all_owners": "222",
        "hs_updated_by_user_id": "222",
        "hubspot_owner_id": "111",
        "hs_all_owner_ids": "111",
        "hubspot_owner_assigneddate": "1600353208392",
        "hs_createdate": "1600353208392",
        "hs_lastmodifieddate": "1608048865751"
      },
      "contacts": [
        {
          "id": 1,
          "first_name": "First",
          "last_name": "Recipient",
          "email": "firstrecipient@hubspot.com",
          "phone": "12354678981"
        },
        {
          "id": 2,
          "first_name": "Second",
          "last_name": "Recipient",
          "email": "secondrecipient@hubspot.com",
          "phone": "12354678982"
        }
      ],
      "line_items": [
        {
          "createdate": "1/1/20",
          "hs_position_on_quote": "0",
          "id": 1,
          "name": "First sample line item",
          "description": "About first sample line item",
          "price": "1005",
          "discount": "5",
          "hs_cost_of_goods_sold": "10",
          "hs_margin_tcv": "990",
          "hs_margin_acv": "990",
          "hs_margin": "990",
          "hs_tcv": "1000",
          "hs_acv": "1000",
          "amount": "1000",
          "quantity": "1",
          "hs_line_item_currency_code": "USD",
          "tax": "10",
          "hs_lastmodifieddate": "1/1/20",
          "hs_created_by_user_id": "1",
          "hs_object_id": "1",
          "hs_updated_by_user_id": "1",
          "hs_recurring_billing_period": "P3M",
          "hs_term_in_months": 12,
          "hs_sku": "123",
          "hs_product_id": "123"
        },
        {
          "createdate": "1/1/20",
          "hs_position_on_quote": "1",
          "id": 2,
          "name": "Second sample line item",
          "description": "About second sample line item",
          "price": "105",
          "discount": "5",
          "recurringbillingfrequency": "monthly",
          "hs_cost_of_goods_sold": "10",
          "hs_margin_tcv": "1080",
          "hs_margin_acv": "1080",
          "hs_margin_arr": "1080",
          "hs_margin_mrr": "90",
          "hs_margin": "90",
          "hs_tcv": "1200",
          "hs_acv": "1200",
          "hs_arr": "1200",
          "hs_mrr": "100",
          "amount": "1000",
          "quantity": "1",
          "hs_line_item_currency_code": "USD",
          "tax": "10",
          "hs_lastmodifieddate": "1/1/20",
          "hs_created_by_user_id": "1",
          "hs_object_id": "1",
          "hs_updated_by_user_id": "1",
          "hs_recurring_billing_period": "P3M",
          "hs_term_in_months": 12,
          "hs_sku": "1234",
          "hs_product_id": "1234"
        }
      ],
      "contact_signers": [
        {
          "vid": 1,
          "first_name": "First",
          "last_name": "Signer",
          "email": "firstsigner@hubspot.com",
          "avatar_url":"https://cdn2.hubspotqa.net/hub/99261937/hubfs/d40aadd5-d110-43f0-bf31-fb20ddb2128c.png/height=48/width=48"
        }
      ],
      "user_signers": [],
      "additional_fees": [
        {
          "name": "Tax",
          "amount": 1000
        },
        {
          "name": "Percent Discount",
          "amount": 25,
          "is_percentage": true,
          "category": "DISCOUNT"
        }
      ],
      "totals": {
        "total": 1100,
        "subtotals": {
          "monthly": { "subtotal": 100 },
          "one_time": { "subtotal": 1000 }
        }
      }
    }
  }
}


Did my answer solve your issue? Help the community by marking it as the solution.