How to reset flow run time to restart a Delta export type

Comments

4 comments

  • Matt Graney Chief Product Officer
    Engaged
    Answer Pro
    Top Contributor

    Hi Paul, if you choose the run icon (the "play" button) in the Flow Builder or from the integration flow list for a delta flow, you will be prompted to either let the flow run per the last run time ("Automatic"), or you can choose to override it ("Custom" option below). I think this is what you mean.

    0
  • Paul Siegerist

    Thanks, Matt but not really my question.  I think I have found an answer myself.  I already have the flow setup to run in 15 minute increments.  It has been working correctly and picks up any deltas from the "Item" saved search that was setup for the Item changes.  My problem was a change is going to occur to every item in NetSuite and I did not want that large of a delta to be sent to the receiving app via the flow that is setup to handle the changes.  So I am using the "options.data.lastExportDateTime" value to compare to when the all item change has been made and I will work around that value to make sure that all the items are not sent to the target app via the integration.  Here's the code in the preSavePage script:

    // add last update check to be used when a full item refresh has been performed at the NetSuite level
        if(options.data.lastExportDateTime = "2023-06-20T19:35:08.568Z"){
          console.log('Script not run');
          return;
        }

    I will manually get the DateTime value from the total Item change and put it in after disabling the flow while the customer makes the changes to all the items.  If there is a range of times, I will add that to the script to avert a complete item update to the target system via the flow.  All subsequent changes should work fine once the "lastExportDateTime" continues with delta changes. |




    0
  • Scott Henderson CTO
    Celigo University Level 1: Skilled
    Answer Pro
    Top Contributor

    I think Matt was hinting at doing something like the following.

    1. Turn off your flow.
    2. Run your mass update in NetSuite.
    3. When the mass update is done, go an update 1 single item.
    4. Turn flow back on, and hit the run button, and set a custom date to be right before you updated the single item so that the delta flow gets at least 1 record (but skips all the mass update changes).
    5. Let the flow run on schedule after this test run, and then it will only get item changes after the custom date you set.
    0
  • Tyler Lamparter Principal Product Manager
    Awesome Follow-up
    Engaged
    Top Contributor
    Answer Pro
    Celigo University Level 4: Legendary

    Alternative to Scott Henderson's and Matt Graney's suggestion, which would work, you could potentially make this a bit more automated. This does assume that the global updates you are making are to fields that shouldn't every trigger the flow to send an update even if not mass updated. I had a similar use case at my last company where some fields would get updated daily, but those fields had no reason to trigger updates to external sources.

    1. First option could be to add search criteria to your saved search that filters on the system notes. You could filter out system notes where the field that changed is the one or ones you don't want to trigger this flow off of. You could also filter on context and filter out where your context is a csv upload or something else. If you do this, you also have to make sure to summarize the results of your search so you don't have duplicate results returned for each system note. This can be fairly detrimental to the saved search performance so you may also filter system notes datetime to just the past 24 hours or so.
    2. Second, you could create a beforeSubmit function or workflow on your item records that updates a custom timestamp field when certain things are updated or within certain contexts. From there, you could choose that timestamp on your delta export instead of native last modified date.
    0

Please sign in to leave a comment.