Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

SOLVED

String concat in webservice

Avatar

Former Community Member

Hello!

I've created a webservice that reads a value from a database using this SQL statement:

SELECT ID from sequencias WHERE ( ref = {$ /process_data/@refFormulario$});

This just returns a number (in a string output variable) to the form.

Now I need to concatenate a slash and the current year. So if the the number is, say, 345, I need to add "/2011".

Question: should I add another Task or is there a way of using a string function (like Concat) to do this?

And... how do I do it? I've tried to use concat when building the Data mapping, but it did not work.

Thank you for any hints!

Marcos

Add topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Option1 :

You can concatenate this string in the SQL statement itself which is faster than any other options below.

Query (for Microsoft Sql Server database)

Query (for MySql database)

Option 2:

Concatenate the result string from web service using a SetValue activity at the end of web service workflow.

Assignment:

Assuming that the output variable name is "result"

Option 3:

After the data gets populated in the form field, you can change through either JavaScript or FormCalc.

Nith

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Option1 :

You can concatenate this string in the SQL statement itself which is faster than any other options below.

Query (for Microsoft Sql Server database)

Query (for MySql database)

Option 2:

Concatenate the result string from web service using a SetValue activity at the end of web service workflow.

Assignment:

Assuming that the output variable name is "result"

Option 3:

After the data gets populated in the form field, you can change through either JavaScript or FormCalc.

Nith

Avatar

Former Community Member

Hey Nith!

Thank you very much, once again!

I used the Workbench solution, worked perfectly!

Thank you!

Marcos