1 Reply Latest reply on Jul 2, 2018 2:26 PM by Sanford Whiteman

    Appending data with a webhook - protecting good data being overwritten with bad

    Michelle Wollen

      Hi all, we have a webhook set up to append employee size, annual revenue etc.  Since getting it up and running we have found that it is overwriting some good data with 0s.  We have been looking at different ways we can protect the existing data and only overwrite if it is a higher value but keep hitting barriers.

       

      For example, we have looked at using two fields and overwriting with Field 2 if Field 1 is less than Field 2 but although it accepts the IF statement it does not run correctly.

       

      This can't be an issue only we are experiencing.  Has anyone found a solution to this? 

        • Re: Appending data with a webhook - protecting good data being overwritten with bad
          Sanford Whiteman

          First, for clarity in later searches, let's use the term "enriching" rather than "appending" here. Of course, I know that what you mean is populating data values in full via a web service, but literally "appending" to data fields (as in concatenating new values with old values, instead of overwriting) is another area of interest.

           

          As you've noticed, directly calling a "dumb" webhook service can result in some data management headaches.

           

          There are 2 ways to deal with what you're describing:

           

          1. Write the webhook results to proxy fields (i.e. not the primary/production fields).  Then trigger on Change Data Value and apply Flow-based logic to determine whether to update the primary fields. It seems like that's what you meant by "IF statement" but you didn't show what you'd tried. The problem with this approach is you need a separate proxy field for every field you want to conditionally update, which can lead to errors (and certainly leads to cosmetic clutter).
          2. Use a more intelligent webhook engine in-between. You pass that webhook the current value of the fields together with the logic for when/what to update. That engine relays the call to the external service and pre-processes the results, only passing back filtered data. This is, naturally, the way we do it.