Discussions

 View Only
  • 1.  Duration field in Pipeline Outlook channel

    Posted 11-10-2021 17:29
    Hi,
    I am creating a pipeline using the Outlook channel to send an email.  I have a duration field {{a.days}} in the body of the email that is not coming through correctly.  A value of 2 days comes through as 172800000.  Any ideas on how to have it display correctly?

    Thanks,
    Deb

    ------------------------------
    Deb Lanser
    ------------------------------


  • 2.  RE: Duration field in Pipeline Outlook channel

    Posted 11-10-2021 17:50
    Edited by Mark Shnier (Your Quickbase Coach) 11-11-2021 10:16
    Do you want to come through as an integer number of days?  Or could there be fractional days or minutes and hours?

    If you have a duration which is really the time span between two date fields then you could make a numeric formula field in native QuickBase called  [# of Days]. The formula would be

    ToDays([my duration field])

    Then use that field in your email.

    That large value you are seeing is the number of milliseconds in two days.  60 * 60* 24 * 2 * 1000 = 172800000.





    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Duration field in Pipeline Outlook channel

    Posted 11-11-2021 10:01
    Creating the formula field worked perfectly!  Thank you for your help!

    ------------------------------
    Deb Lanser
    ------------------------------



  • 4.  RE: Duration field in Pipeline Outlook channel

    Posted 08-04-2022 09:48
    Coach, did you give this advice because of any limitations in Pipelines with duration fields? Can I use them in calculations like I would in a formula duration field?

    I'm trying to create a Pipeline to track how long a record stays in a certain status and part of that is trying to set up a calculation using duration fields and insert that value into a field in an Update Record step. However, it threw this error:

    Validation error: {'time_in_received_status': ["field 'time_in_received_status' could not be coerced", 'must be of integer type']}

    I could have other mistakes in what I'm doing, but I just want to make sure I can create duration calculations here or if I need to create fields in the form to do that. 

    Thanks!

    ------------------------------
    Tate Forgey
    ------------------------------



  • 5.  RE: Duration field in Pipeline Outlook channel

    Posted 08-04-2022 10:02
    Ya, sorry, I don't really know how to work with Durations in Pipelines.


    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------



  • 6.  RE: Duration field in Pipeline Outlook channel

    Posted 08-04-2022 10:18
    Well, it makes me feel a little better that this is on the fringes of even your vast knowledge. Thanks for the response.

    ------------------------------
    Tate Forgey
    ------------------------------



  • 7.  RE: Duration field in Pipeline Outlook channel

    Posted 08-04-2022 14:01
    Using API records call I have a PO duration field that I pull into a pipeline. Comes from PO End date - PO Start date. The goal is to take the number of months for the PO and break the PO amount into what the monthly invoice forecast would be and create a child record for each month. 

    {
    "to":"insert appID",
    "data": [
    {% for num in range (quickbase_on_new_event_1.po_duration | int) %}
    {
    "6": {
    "value": "{{quickbase_on_new_event_1.po_start_date + time.delta(months= (num+1)) }}"
    {# FID 6 month #}
    },
    "7": {
    "value": "{{quickbase_on_new_event_1.po_monthly}}"
    {# po monthly to FID 7 amount #}
    },
    "8": {
    "value": "{{quickbase_on_new_event_1.po_number}}"
    {# related po FID 8 #}
    }
    }
    {% if loop.last == false %},{% endif %}
    {%- endfor %}
    ]
    }

    ------------------------------
    BRIAN HINSHAW
    ------------------------------