Retrieving Client details in Security Hash assignment

Hi I am having problems with this string manipulation

Field ClientDetails has this value:

image

Then after applying this formula to get ClientItems:

ClientDetails.Split(Environment.NewLine.ToArray,StringSplitOptions.RemoveEmptyEntries)

Field ClientItems has this value:

image

@ColinCrabtree to get those three client id l,name,country. Once you used get text activity store them in a variable say outtext.
Now in assign activity give like this **outtext.split(“:”.tochararray)**you will get output as array of string say strarraynow to based on index values of client id,name,country give like this strarray(indexvalue).trim.hope this helps you

@ColinCrabtree

Use Get Text Activity and Indicate those client details and store it in a string variable and say ClientDetails then try below.

ClientDetails.Substring(ClientDetails.IndexOf("Client ID: ")+"Client ID: ".Length).Split(Environment.NewLine.TocharArray)(0)

For other two also follow same way.

1 Like

Hi @lakshman

I did have the Get Text activity into ClientDetails already coded.
I just applied your formula (copied below for reference) into the 3 fields ClientId, ClientName and ClientCountry respectively:

ClientDetails.Substring(ClientDetails.IndexOf("Client ID: ")+"Client ID: ".Length).Split(Environment.NewLine.TocharArray)(0)

After concatenating the 3 fields into the HashResult field and typing into the Hash Generator it looked as follows which was perfect.

image

This solved my issues. will mark it so. Thank you very much !!! :grinning:

PS:It is clear that string manipulation is complex and unfortunately it is not covered in detail in any course offered. It would be good for the academy to offer a course on string manipulation. where can one get a user guide for syntax and commands?.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.