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

I have a scheduled flow that runs every fifteen minutes and looks for deltas in NetSuite Items and then pulls them in and sends them to another app.  There will be global changes made at the NS item level that will effect every item record.  I want to make the changes at NetSuite and turn off my "item update" flow so the changes do not automatically move to the outside app.  I will then export the items and move them into the outside app and then turn the Item update flow back on, but I want to start the flow delta back to "the first time"  I've not seen anywhere where I can reset time the flow last ran so it doesn't update the bulk load that I just ran on the target system.

Simply, can I change the flow schedule back to a target time (after I do the full load) with the flow?

Thanks,
Paul

0

Comments

4 comments
Date Votes
  • 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
  • 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
  • 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
  • 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.

 

Didn't find what you were looking for?

New post