I'm building a flow that takes the subscriptions listed on our contract record and creates a record in a custom object called Entitlements. Our contracts may have the same subscription listed more then once, so I have created a loop that will make a decision on if it has seen the subscription before. If it has it will skip it and if it has not then it will add it to my Record Collection to be created. Originally this was setup using the subscription ID's but I switched it over to Product name for trouble shooting.

It appears to be working except for one small issue. On the contract I'm testing with I'm expecting 11 subs to be created. Each time I only get 10. It appears that the last record being processed never gets created. If i change my Get Record sort order or the loop direction, The original item that was missing will appear (first in list) and what I now would expect to be the last is missing.

Anyone have any ideas? I have another loop that is similar later in the Flow that is doing the same type f thing as well

enter image description here

UPDATE - WORK AROUND Been working with Salesforce on this one and they have confirmed that its not working correctly but do not know why as of yet. They were able to find a simple workaround.

Basically the assignment action that adds the values to the record variable then adds the record to the Record collection that is used to create looked like this.

enter image description here

We took the last line that adds the record to the record collection out of this assignment and moved it to its own assignment. By doing this the last items that was missing is now be created

enter image description here

  • Have you run it and analyzed it in the debug menu? First thing to check is that the correct number is entering the loop. It might not be pulling as many as you expect. Then I'd check the last one and see if it's following the path you think it is. It might be the decision is catch it as already processed when you're expecting it to go to not processed. – denvergreene May 20 '20 at 15:43
  • @denvergreene I'm still going through the data in the Debug. Not the best at reading it but also have not had lot of time. I know that the issue is not with the Get Record. If I change the Direction to process ion the loop, a different items is missing. – Shawn M May 20 '20 at 22:24
  • That is super weird. Does the debug log show anything useful for the create and get elements? This is a long shots but maybe the Get (and view) has a filter that causes it to miss one of the 15? – denvergreene May 21 '20 at 15:35
  • It shows just the 14 being created with no errors. It is so weird. and that fact that its always the last one in a little mind boggling. If I change the direction of processing on the loop, the one that is missing will be created, but the one that was original item that first (now last) will not be created. – Shawn M May 21 '20 at 15:58
  • I have updated the question with a workaround that we have found to this. Salesforce Support is still trying to determine root cause, but it does appear to be a bug. Work around is very easy. – Shawn M May 28 '20 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.