Forum Discussion

RameshSingh's avatar
RameshSingh
Qrew Member
2 years ago

Pipeline help

Hello,

currently I have 3 pipeline set to updates the dates. I am using the workflow of record updated and update records, but I am running into issue where it isn't properly recording the date/time.
The use case is:

1) If the attempt= first, update first attempt=current date/time
2) if the attempt=second, update second attempt= current date/time
3) if the attempt=third, update third attempt= current date/time

So all three pipelines are having the data but sometime it is recording incorrectly. Could you please advise if I am able to use this case in only one pipeline. Let me know.

Thank You

------------------------------
XYZ
XYZ
------------------------------
  • @XYZ

    I am going to make an assumption and say that the first attempt, second attempt, and third attempt Date/Time fields are in the same record. In this case, I would use structure the pipeline so that it used Jinja2 Expressions (more specifically, Logic Conditions) to determine if the value in a field should be updated to the current date/time or not:

    Trigger: Record Updated
    When: Attempt is changed AND (Attempt == "first" OR Attempt == "second" OR Attempt == "third")

    Action: Update Record (from trigger)
    Update field values to:

    First Attempt:

    {% if  a.attempt = "first" %}
    {{time.now}}
    {% else %}{% endif %}

    Second Attempt:

    {% if  a.attempt = "second" %}
    {{time.now}}
    {% else %}{% endif %}

    Third Attempt:

    {% if  a.attempt = "third" %}
    {{time.now}}
    {% else %}{% endif %}


    ------------------------------
    Justin Torrence
    Quickbase Expert, Jaybird Technologies
    jtorrence@jaybirdtechnologies.com
    https://www.jaybirdtechnologies.com/#community-post
    ------------------------------
    • RameshSingh's avatar
      RameshSingh
      Qrew Member
      Hello Justin,

      Thank you for the answer. I am still running into validation issue for this pipeline. Not sure what might be the reason. It says expected token 'end of statement block', got"="

      My code is:

      {% if a.number_of_attempts = "First Attempt" %}
      {{time.now}}
      {% else %}{% endif %}

      Please let me know if you have any idea regarding this.

      Thank you,
      Fanil

      ------------------------------
      XYZ
      XYZ
      ------------------------------
      • DougHenning1's avatar
        DougHenning1
        Community Manager
        The comparison of equals in Jinja is ==, like this:

        {% if a.number_of_attempts == "First Attempt" %}

        ------------------------------
        Doug Henning
        ------------------------------