Micro Focus Expert
Micro Focus Expert
616 views

Convert string values to array using HP Connect-it

Jump to solution

Hi All,

I'm struggling with an issue to pass the values from the string to an aaray,

 

Dim Mainstring
Dim Mystr
Mainstring = "value1~value2~value3"
Mystr = Replace(Mainstring ,"~","" & Chr(13) & Chr(10) &"")
RetVal = Mystr

The value is inserting in MF Service Manager array field as:

 

value1value2value3

The requiement is to put the values in the MF Service Manager array field is:

value1
value2
value3

Please suggest I have tried multiple ways but none working, have also refered to below urls:

Connect-It-parsing-crlf      &

 Convert-string-to-array-via-Connect-It

Please provide some valuable suggestions

Thanks

Neo

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Convert string values to array using HP Connect-it

Jump to solution

Dim Mainstring
Dim Mystr
Dim i

Mainstring = "value1~value2~value3"

FOR i = 1 TO CountValues(Mainstring,"~","\")
   Mystr = Mystr & ExtractValue(Mainstring,"~","\") & Chr(13) & Chr(10)
NEXT i

RetVal = Mystr

4 Replies
Highlighted
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Convert string values to array using HP Connect-it

Jump to solution

Dim Mainstring
Dim Mystr
Dim i

Mainstring = "value1~value2~value3"

FOR i = 1 TO CountValues(Mainstring,"~","\")
   Mystr = Mystr & ExtractValue(Mainstring,"~","\") & Chr(13) & Chr(10)
NEXT i

RetVal = Mystr

Micro Focus Expert
Micro Focus Expert

Re: Convert string values to array using HP Connect-it

Jump to solution

Hi  Mark Cullen_1 

Many Thanks for your response, The logic in the code looks pretty much fine & should work, but unfortunatley it is not wokring,

Still the values are coming a plain string format, please refer to screenshot below:

CIT-1.JPGMF SM Capability Word ArrayCIT-Mapping.JPGConnect-it Mapping

Please Suggest

Thanks a gaian for your assistance

Neo

0 Likes
Acclaimed Contributor.. Mark Cullen_1 Acclaimed Contributor..
Acclaimed Contributor..

Re: Convert string values to array using HP Connect-it

Jump to solution

Thanks for the mapping screenshot.  You may want to review Collection mapping in the help.  There should also be something related with string to collection.  Good luck.

Micro Focus Expert
Micro Focus Expert

Re: Convert string values to array using HP Connect-it

Jump to solution

Thanks a lot Mark Cullen_1

The code is working fine, in the collection mapping , the array field was not accepting the values, I tried creating a custom array field & pushed the values in teh custom array in order to test the code, in the custom field array field was able to acept the values.

Thanks again for your assistance.

Cheers

Neo

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.