If I understood the problem correctly, here's what to do :-
Approach : Use a decision stage to confirm if the collection row contains SettingB. If yes, then extract last 3 characters, Else continue looping.
Code :
Loop Start
Function inside Decision Stage : InStr([Collection.ColumnName],"SettingB")>0
Connect Yes to Calculation Stage having : Right([Collection.ColumnName],3) and store in a data item
Connect No to Loop End
You will get the value in data item
Hopefully you will be able to understand this. I don't have access to Blue Prism, currently, to post an image.