- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 05:20 PM
Hello,
I have a string contains "abc\1234"
I would like to extract from the back slash and get the number only such as "1234"
Can someone please help? Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2023 11:43 PM
@Annie10 Please continue to use double back slashes, generally \ has a special meaning example: \n is for the next line and hence scripting languages doesn't allow you to type one single backslash and to cut the meaning of backslash you have to use double slashes.
Conclusion is \\ is equivalent of \ in a string.
Please use the same line of code and it should work fine.
return source.u_name.slice(source.u_name.indexOf('\\')+1);
Thanks!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2023 12:16 AM
@Annie10 I believe you are trying to import data using import set, please see my excel sheet and the result using the same code
Excel sheet with the data:
Transform Map (Field map updating the incident description):
Updates on the incident:
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 10:54 PM
Thank you so much for continuing provide support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 10:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 12:44 AM
@Annie10 indexOf will return the position of the \ symbol, +1 is to instruct the system to pick up the string after the \ symbol.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2023 10:47 PM
Hello @Annie10
Please try the below script.
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.