ramirez_matiasf
Nintex Newbie

How can I Get a Substring of a Worhflow Variable?

Hi, I need help to trim a WS Response.

We have a Web Service configured to respond strings like this:

000000000000102Incidente creado correctamenteINC000001769286

 I need to get only the part that says: INC000001769286

I tried using de task "Set a field value" with the function fn-substring:

and this is what I get:

Thanks!

0 Kudos
Reply
8 Replies
murphybp2
Nintex Newbie

Re: How can I Get a Substring of a Worhflow Variable?

You can't use an inline function within a Set a field value.  Use the Build a String action to get your substring and store the results in a variable.  Then use the variable withing the Set a field value. 

Reply
emha
Automation Master
Automation Master

Re: How can I Get a Substring of a Worhflow Variable?

which column have you updated, last one?

then it looks like content of 'txt_resultado' is little different to what you have provided.

it seems to be a XML, which is quite usual web service output.

to get a (sub)string out of XML with substring function is not correct approach . you should rather use Query XML action and specify XPath expression to pick data of interest.

so, proofcheck the output you get from web service.

if you don't mind to post that output here and explain what exactly you need to get, we might help you with that.

Reply
ramirez_matiasf
Nintex Newbie

Re: How can I Get a Substring of a Worhflow Variable?

Hi Brendan, Thanks for your answer.

I tried building a string but I get the same result. The web service response is saved in a variable called "txt_resultado". When I insert it in a notification I can see the message OK, but when I tried to get a substring it shows the message of the last column in the screen of my first post.

For example, in this notification the variable txt_resultado has the WS response, and the variable ticket has the substring built in the way you recommended me.

0 Kudos
Reply
ramirez_matiasf
Nintex Newbie

Re: How can I Get a Substring of a Worhflow Variable?

Hi Marian, The column is the last one.

I don't believe that the answer of the WS is a XML, because when I use it in a notification I can see the message OK.

0 Kudos
Reply
ramirez_matiasf
Nintex Newbie

Re: How can I Get a Substring of a Worhflow Variable?

Marian, I have been analyzing and you're right, the response of the WS is a XML.

What I need is a XPAT expression to transform that response in text.

I'm sorry but I'm not allowed to post the complete XML.

Thank you! 

0 Kudos
Reply
emha
Automation Master
Automation Master

Re: How can I Get a Substring of a Worhflow Variable?

do change notification message format to plain text and let it send once again.

this way XML elements are being interpreted as markups and you do not see real result.

Reply
ramirez_matiasf
Nintex Newbie

Re: How can I Get a Substring of a Worhflow Variable?

Hi Marian, In that way I can see the real result!

Thank you!

0 Kudos
Reply
emha
Automation Master
Automation Master

Re: How can I Get a Substring of a Worhflow Variable?

so you will have to fight with it on your own.

as I've written use query XML action, there is as well buit-in XPath builder. it's not always 100% reliable but it could give you at least a clue how a proper XPath expression should look like.

0 Kudos
Reply