cancel
Showing results for 
Search instead for 
Did you mean: 

How to return only the first string

Former Member
0 Kudos

Hi Guys,

I have a mapping where I am creating a filename from data in within my data file, I am using one of my variables i.e. Account

The data looks like this

Account:

123

123

123

456

456

456

789

789

789

What I want is to is return only the first row u201C123" and concatenate it with a constant to make up the filename.

Any help will be appreciated.

Kind Regards,

CJ Bester

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

very simple

use copy value standard function like below.

Account------->copyvalue(0)----------->
                                                                  CONCAT------------->TARGET
                                     Constant------->

Regards,

Raj

Answers (2)

Answers (2)

monicabhosale
Active Participant
0 Kudos

Hello,

To get first row value to crete filename you can create one variable at target side and using UDF you can retrieve only first variable value and store in temporary created variable at target side and use that variable in file name.

else you can use count and using that store first row variable in your temporary target variable if you dont want to go with UDF.

i hope this will help you.

Thanks

Monica

Former Member
0 Kudos

In message mapping, use the standard node function collapseContext to get the first value. Keep the context of the Account field at the root level

Former Member
0 Kudos

Awesome it works thanks