- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 04:04 AM
Hi all,
Is there a way to wait for a record to be created in a flow? I have a scenario where part way through a flow I need to wait for a record to be created and therefore can't initiate it through a trigger condition.
Thanks
Steve
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 12:50 AM
Hi Steve,
thanks for the clarification.
Because it is happing outside of the flow, why not making a separate flow that triggers on the creation of that record?
If you really want to have the check in the same flow, you can use the 'do untill' and query for the record with a wait timer in it, and if the query fetches the record, the untill stops. (dont forgete to make a failsafe like, if its the 10th time it escapes with an error or something.) Just to prevent infinite looping.
Good luck,
Collin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 03:51 AM
@Community Alums
Thank you for your kind of words.
Yes! I hope you would find best idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 05:29 AM
Hi Steve,
im missing some context... where is the record been created? Is it in the same flow or is it happing outside of the flow?
Kind Regards,
Collin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 07:26 AM
Hi Collin,
The record is being created external to the flow. It is actually a work item record that is being created as part of a chat. It is normally created by the time the flow runs, however, there are occasions where it is taking longer (perhaps the creation of the record is running on a slower node). So I want to check to make sure it is created first. I am currently doing the whole process related to this in a script, and have a loop doing a GlideRecord query to check for the record, but would like to do this in a more performant and stable way within a flow instead. I had originally thought this would be possible with the 'wait for condition' action, and didn't realise it only (seemingly) works for existing records.
I have a similar scenario with 3 internal API calls that even though I get a 200 returned from it, there are examples of where the action that the API call has not completed before my script completes (bizarre I know!). These scenarios will be OK to handle with the wait for action as the records in question already exist.
The main reason for converting this script to a flow was due to the issue with the API calls, but was hoping to be able to handle the check on the work item in a similar way. It maybe I will have to continue with the scripted loop and just have it in a script action.
Thanks
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 12:50 AM
Hi Steve,
thanks for the clarification.
Because it is happing outside of the flow, why not making a separate flow that triggers on the creation of that record?
If you really want to have the check in the same flow, you can use the 'do untill' and query for the record with a wait timer in it, and if the query fetches the record, the untill stops. (dont forgete to make a failsafe like, if its the 10th time it escapes with an error or something.) Just to prevent infinite looping.
Good luck,
Collin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 01:14 AM
Thanks Collin.
Unfortunately this part of the flow and the rest of it can't be separated out as there are variables that are passed to the main flow and there is no easy way to get this to be part of a separate flow without significant redesign, which I am not in a position to do.
Satoshi suggested using the wait for duration flow logic which I guess would provide the same results as having a do until and a wait timer. This type of solution seems to be the best approach.
Thanks for spending the time to try and help me with this!