cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting string from a field in collection

ArdraM
Level 2
Currently, my collection has a field that looks like this: SERVER\Download\Imp\US12345_GL. how can I extract US12345_GL alone to a new field in the same collection ?
4 REPLIES 4

Soumya21
Level 6
Hi @Ardra M

You Can use Get collection Fields action to take fields after that Loop through Fields and take the field name which u have mentioned and use Right or Left functions to extract string, then you will be having extracted string in one data item so by that name u can create field in collection.

Thanks,
Soumya

If your file name is always going to be 10 alphabets then you can use - Right("SERVER\Download\Imp\US12345_GL",10)

If that is dynamic below is a better approach. I'm Attaching the required snaps for you to configure and try.

35124.png35125.png35126.png35127.png35128.png35129.png

Let us know how it goes for you and if you need more help.

Thank you for using the Blue prism community.

ArdraM
Level 2
@Soumya21 and @Tejaskumar_Darji : Thank you very much for the response. Unfortunately, string length varies so can't use right, and left functions. I've implemented the code to reverse the string along with the instr function to get the desired result. Thanks again​​

MichealCharron
Level 7
@Ardra M

You can also use the "Split Path" action in Blue Prism's "Utility - File Management" VBO. The "File Name" output parameter will give you the value after the last backslash.​​
Micheal Charron
RBC
Toronto, Ontario
Canada