Inline Function Substring not working for me


Badge +2

I have a description field for an article and from that I want to automatically create an intro.

 

I use the inline function substring for this. The thing is when I try to execute it it doesn´t work in the actual workflow but it does in the "Run Now" section in the Build String node.

 

Example of how I do it:

  • Description text
    • Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget nulla vestibulum, molestie libero ac, porttitor eros. Fusce rutrum quis lorem quis imperdiet. Morbi condimentum nec lacus at aliquet.
    • The function
      • fn-Substring({WorkflowVariable:mtext_itemdescription},0,20)
    • The output
      • fn-Substring(Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean eget nulla vestibulum, molestie libero ac, porttitor eros. Fusce rutrum quis lorem quis imperdiet. Morbi condimentum nec lacus at aliquet.,0,20)

  • As I said, the same works in the "Run Now" section.

 

Can anyone help on this?


12 replies

Userlevel 6
Badge +16

I suspect it's language related.

Are you working on an English site or another language?

Badge +2

Hi Fernando!

Actually I am trying this in Lorem Ipsum (dummy language), the same as in my example. There are no special characters.

-gunnar

Userlevel 6
Badge +16

Have you tried it on an English site?

Badge +11

I agree with Fernando. I'd eliminate the dummy language to make sure it had nothing to do with that.

Badge

I am having a very similar issue and have tracked it down to be the commas in the text.  I am also having the same issue with "(" and ")" characters.  Has anyone found a solution for this?

Userlevel 5
Badge +12
  • Try the following instead: note I wrapped your variable in {TextStart}{TextEnd} tags
  • fn-Substring({TextStart}{WorkflowVariable:mtext_itemdescription}{TextEnd},0,20)

Thanks

Mike

Badge

That fixed my issue.  Thank you, Mike!!

Userlevel 5
Badge +12

Welcome! happy.png

Badge +11

Hey Mike M! I am having trouble with this exact same issue. I am using the substring function. It returns with part of the substring text in the beginning of my text and at the end. And it isn't returning 75 characters but the entire string.

My function looks like this:

fn-Substring((Article),0,75)

Article is a variable. If  you'd like me to make this a new question I can.

Userlevel 5
Badge +12

Hi Lisa,

Have you tried:

  • fn-Substring({TextStart}{WorkflowVariable:Article}{TextEnd},0,75)

If not, give it a shot and see what comes back.

Thanks

Badge +11

Now it returns empty. This is populating a multi-line textbox that is enhanced rich text. It has some style stuff in front of the actual text.

Badge +11

Ok! It works....its just including all of the html and stuff.

Thanks so much!

Reply