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
Comments
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.
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. |
I think Matt was hinting at doing something like the following.
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.
Please sign in to leave a comment.