Discussions

 View Only
Expand all | Collapse all

updating records

  • 1.  updating records

    Posted 08-17-2022 13:44
    Edited by Lorrie B 08-17-2022 14:54
    Hello, 

    I need to find a way to automatically uncheck a box if the record is updated and the box is checked on the record that should be current and used. 
    An example would be when a new record is entered and the most recent POC box is checked it would uncheck that box in other records related to that member. 


    ------------------------------
    Lorrie B
    ------------------------------


  • 2.  RE: updating records

    Posted 08-18-2022 08:21
    If the records are related in some way, this is a good candidate for a pipeline. 

    Trigger pipeline on update
    Search for records related to pipeline
    update checkbox to NO

    ------------------------------
    Dwight Munson
    ------------------------------



  • 3.  RE: updating records

    Posted 08-18-2022 10:07
    Hi Dwight, 

    Thanks for the reply! Yes, I had thought of pipelines too, but in my experience with pipelines so far it has not been user-friendly. I'm never really sure how many fields to add and reference back to or how that works with the other information and selections. 

    So in this instance - to search the records would that be through finding a common field such as fields with the same customer ID, or would I use a related record field?


    ------------------------------
    Lorrie B
    ------------------------------



  • 4.  RE: updating records

    Posted 08-18-2022 10:18
    If they're related via a parent. 
    Customer -> Child

    A.
    Trigger when Child is updated.
    Fields to pass: Customer ID, POC Checkbox
    Condition: If POC checkbox is true

    B. Search for Records
    Where Customer ID is {{a.Customer_ID|int}} and POC checkbox is true

    For Each Do:
    Update record
    POC Checkbox is NO

    ------------------------------
    Dwight Munson
    ------------------------------



  • 5.  RE: updating records

    Posted 08-18-2022 10:21
    But you need to exclude the parent in some way from the search so that it doesn't uncheck that one. To the search you could add Record ID is not {{a.id|int}}

    **I always add |int to the record IDs because I'm forgetful in which situations pipelines add a decimal to them and |int will always format it as a whole number.

    ------------------------------
    Dwight Munson
    ------------------------------



  • 6.  RE: updating records

    Posted 08-18-2022 10:36
    In the query options, it only allows me to set the "most recent POC" field with an "is" setting. When I try to include the record ID to the parent record it doesn't give me an option to add an "is not" setting. This would have been so much easier to set up in the old automations feature.

    ------------------------------
    Lorrie B
    ------------------------------



  • 7.  RE: updating records

    Posted 08-18-2022 10:45
    It would be similar to this: 



    ------------------------------
    Dwight Munson
    ------------------------------



  • 8.  RE: updating records

    Posted 08-18-2022 12:26
    Ok, that clarifies quite a bit - so then, for step C to Update the record it would be the most recent set to no, and still add the fields for customer name and customer ID?

    ------------------------------
    Lorrie B
    ------------------------------



  • 9.  RE: updating records

    Posted 08-18-2022 15:17
    Edited by Dwight Munson 08-18-2022 15:21
    You only need to add the field that you're updating.
    For instance in this pipeline I searched for an existing record in Step C where the Registration ID (key) was equal to {{b.id}}. 

    I didn't need to list that field in Step D with the updates, because the record already has that field. 



    ------------------------------
    Dwight Munson
    ------------------------------



  • 10.  RE: updating records

    Posted 08-18-2022 16:26
    Ok, would I need to do anything differently if the information is part of a relationship and in the same table?

    ------------------------------
    Lorrie B
    ------------------------------



  • 11.  RE: updating records

    Posted 08-18-2022 16:36

    What does your relationship diagram look like for it? Such as Tasks ---> Tasks, 
    or Tasks ---> Dependencies <---- Tasks

    For instance I have: 



    ------------------------------
    Dwight Munson
    ------------------------------



  • 12.  RE: updating records

    Posted 08-18-2022 16:57
    The records and checkbox are in my Plan of Care Table, and that table has a relationship to another table named CSEDW. So the checkbox would have to be turned on and off in the Plan of Care Table - and some records in that Plan of Care Table are populated from the relationship linked to the CSEDW table. 


    ------------------------------
    Lorrie B
    ------------------------------



  • 13.  RE: updating records

    Posted 08-18-2022 17:03
    I see. Same thing pretty much. Just search for the records in the plan of care table using Related CSEDW as the search parameter. 

    Or, are you saying that only SOME records are related to the CSEDW?

    ------------------------------
    Dwight Munson
    ------------------------------



  • 14.  RE: updating records

    Posted 08-19-2022 10:29
    So records entered into the POC table can display in the CSEDW table with an Add POC button in the CSEDW table - as well as being able to add a new record in the POC table. Another issue this could cause is the pipeline won't run if only tied to the POC table, because when someone clicks Add POC in the CSEDW table it doesn't run the Pipeline...I so wish they would have just left the option for automations for simpler situations.

    ------------------------------
    Lorrie B
    ------------------------------



  • 15.  RE: updating records

    Posted 08-19-2022 10:46
    If the trigger is adding a POC record, it doesn't matter if it's added from the POC table itself or from an API_GenerateAddRecord button on the CSEDW (waiver) table. Either way a new record is being created in that table. We just need to lock down the appropriate triggers for the pipeline. 

    So a POC could have a waiver as a parent, but doesn't need one. Does the box only matter for the waiver? You mentioned Customer ID before. I didn't see a customer table, but it seems like even if there is not a parent waiver, that the Customer ID can be the same across multiple records.

    So when a new POC is created, you could search for all others with the matching Customer ID and uncheck the box.

    ------------------------------
    Dwight Munson
    ------------------------------