- Community Home
- >
- Software
- >
- HPE Morpheus Software
- >
- HPE Morpheus Enterprise
- >
- Extract and convert string from input
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 06:19 AM
10-26-2023 06:19 AM
Extract and convert string from input
Hi,
Can we extract and convert the user input string without using the option list?
For example, the user provides the input “Digital Service”. In the backend, will extract only some characters “DS” and convert to new string and use in service catalogue json.
Thanks,
Aung
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 11:19 AM
10-26-2023 11:19 AM
Re: Extract and convert string from input
It’s possible there may need to be alternate quoting on the objects (or ways of parsing). I simply grabbed the first example of regex with groovy to highlight a way forward.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 10:54 AM
10-26-2023 10:54 AM
Re: Extract and convert string from input
Thanks for your feedback. I used the above syntax with a custom input field name in the instance naming section of the service catalog. However, Morpheus threw a gasket error when we ordered the service catalog.
Thanks,
Aung
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 06:27 AM
10-26-2023 06:27 AM
Re: Extract and convert string from input
Anything between <=%
and %>
is groovy syntax. So regex could be applied to your customOption.fieldName to select only the first character of each word.
Might be able to do (with a quick google):
<%= customOptions.fieldName.replaceAll(/\b\w/g) { it[0] }.toUpperCase() %>