Check for Existing Records in Flow Designer Based on Initial Lookup

Erik Nelson
Kilo Sage

Hello!

I've currently got a Scheduled Flow I'm working on that looks up Asset Records that meet a criteria for retirement, then kicks off a Catalog Request for that work to be completed. So far, I have it set up to Look up the Records, Log the list (I wanted to make sure it was getting the correct data), then for Each record looked up, submit the Catalog Item Request until all requests have been submitted. This portion is processing correctly (if not slowly), but I need to add in a step of checking the record to see if there is already a RITM for its retirement. What would be the best route for doing this check?

Thanks,

Erik

1 ACCEPTED SOLUTION

OlaN
Giga Sage
Giga Sage

Hi,

I believe Tudors suggestion will be hard to implement, it will get complicated (assuming that the asset is set as a variable on the RITM).

Instead I would suggest that you set a field/value on the asset. Whenever the asset is submitted into the retirement flow, set that value, and filter out assets with this value on your next run.

View solution in original post

6 REPLIES 6

Tudor
Tera Guru

Hi Erik,

My suggestion would be to add an additional lookup in your "For each"(I'm assuming that you're using "For each" to loop through the assets) which does exactly what you required. Namely, search to see if there are any sc_req_item records raised for that asset for retirement. If none are found, proceed with creating a new REQ/RITM.

Hope this helps!

 Tudor

OlaN
Giga Sage
Giga Sage

Hi,

I believe Tudors suggestion will be hard to implement, it will get complicated (assuming that the asset is set as a variable on the RITM).

Instead I would suggest that you set a field/value on the asset. Whenever the asset is submitted into the retirement flow, set that value, and filter out assets with this value on your next run.

Hello @OlaN ,

You are indeed correct in stating that the implementation might be a bit tricky, however, I had in mind the following:

  1. the field cmdb_ci is populated on the sc_req_item record. Since we are speaking of retiring assets, I assumed that these also have associated CIs
  2. not creating a new field(cost considerations)

From a speed of implementation and long-term maintenance perspective, I agree that the method that you suggested is high probability better(difficult to assess without the insight into the ongoing implementations and constraints 🙂 )

Hope this explains my reasoning and that this will help Erik.

Thank you for challenging my suggestion.

Regards,

 Tudor

 

Tudor, thank you for explaining your solution.

It makes more sense to use the cmdb_ci field on the RITM record, and it also simplifies the lookup a lot, in contrast to using a variable.