Forum Discussion

MattMakris's avatar
Qrew Cadet
2 years ago

Is there a way to reference the old field value in a pipeline advanced query?

I want to only create a new record if the field 'status code' = '404' and if it was previously '200'. Is this possible in a pipeline?

Matt Makris

2 Replies

  • This was the response from QB Support on this topic when I had the same question

    The March 2021 release is not applicable to advanced queries and is only applicable to the actual field. Advanced queries work in a {Field.Operator.Value} format. We do apologize for the inconvenience. There are always ways to improve Quick Base and we welcome all suggestions. I would suggest posting this to our Feedback forums and sharing it with the community and our developers. You can access the Feedback forums by selecting the blue Feedback tab from the left-hand side of the My Apps page.

    Pete James
  • DonLarson's avatar
    Qrew Commander


    When do the values change from 200 to 404? 

    Does it occur in the first part of the Pipeline as part of larger process where many new values are created and then you want to create the new records?

    If this is true, then you can reference the original value from the beginning of the Pipeline in an If statement.

    I just tested this.  Here is my YAML.

    # Previous value in a If

    # Account slugs:
    # - quickbase[XXXXXX]: Pipeline Token <None>
    - META:
    name: Previous value in a If
    - QUERY quickbase[XXXXX] record search -> a:
    export_fields: '"Numeric Field, Pipeline Text Field" <95, 83>'
    table: '"Parents: Parent" <bp4igy3re>'
    - a<>LOOP:
    - DO:
    - a<>ACTION quickbase record update -> b:
    numeric_field: '404'
    - IF:
    - AND:
    - a<>numeric_field equals 200
    - THEN:
    - b<>ACTION quickbase record update -> c:
    pipeline_text_field: '{{a.numeric_field}}'
    - ELSE: []

    I am doing an Update and not a Create Record, but this does work. It changes all the records in the Parent table to a value of 404. The records where the value was originally 200, it writes a note that it was 200, the rest are blank.

    Don Larson