You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Token Function to remove blanks from retrieved text in Workflow

posted two days ago

Hi all, 

 

Happy New Year!

 

I'm trying to use a token to remove blank spaces however it does not seem to have any effect.

|I have workflow searching for a document and then I use 'Retrieve Document Text' to get it. The input file has no spaces, however with the Retrieve Document Text it seems to add spaces in between pages.

 

 

I thought I would create a token (test)  to get rid of the blanks

I create a multi token and use these settings however the blank space is still there

What am I missing?

 

Any help appreciated

 

0 0
replied 20 hours ago

Hi all, 

Thanks for the suggestions, I've recreated the text file so that I can share the data. I think first step is to confirm I am creating the token as a multi token correctly.

Apologies if I am missing something, I want to try and understanding a few things better. 

This is my Token (Token 1). If its correct this should create a multi token with each number as a value. I think this is my main issue 

The output token is identical to the Retrieve Document Text.

To check that Token one is a multi token I've added another token to get its value at Index[3]. And I think this has identified my problem its not a multi token

Not sure if it helps but in the repository the document uploaded is broken up into a few pages and at the number 60 is where the page ends, so its putting in some kind of value which doesn't seem to be blank as the token function is not picking it up. When I try to paste it into Notepad it as Wes suggests it seems to be a blank value.

Ive uploaded the Txt data I am using.

 

Thanks

Shan

 

Data_Test.txt (2.09 KB)
0 0
replied 20 hours ago

I was able to reproduce the behavior you're seeing.  The complication is that, when using Retrieve Text, some whitespace characters (probably \r\n) are prepended or appended to each page.  Remove Empty Items checks the text, sees that it has characters, and doesn't remove it.  The workaround is to use a Trim function before the Remove Empty Items function to remove prepended/appended whitespace.

1 0
replied 20 hours ago

Thanks for confirming Jacob! I think we posted at exactly the same time almost!

 

I will look into this Trim Function.

0 0
replied one day ago Show version history

Is the starting token actually a multi-value token or just text with multiple lines? The Retrieve Document Text activity can generate a multi-value token split by page, but good to confirm.

The Remove Empty Items function doesn't remove blank spaces from a string of text, it only removes empty values from a multi-value.

You can use Token Calculator with the Substitute function to remove blank spaces, but if it is just text with line breaks you might need to use Pattern Matching to split it into a multi-value token, then Remove Empty Items with "all values separated by..." will do what you want.

Token Function Split on New Line - Laserfiche Answers

1 0
replied one day ago

Shan,

You need to verify that it truly is a blank and not a line with spaces in it. Copy the line and paste it into Notepad to see if the cursor stays where it is at or if it moves.

 

Wesley Funderberg

2 0
replied 21 hours ago

Thanks Wes, thats a great suggestion, I always forget that one. I've copied and pasted and it is just an empty line.

0 0
replied 21 hours ago

From your screenshot, it does not look like you have a multi-value token, but rather a multi-line paragraph of text. See Jason's post below on how "remove empty items" works.

 

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.