Missing quation marks in output variable

Hi all

I’m brand new into using and working with Uipath, and despite several videos and google searches I can’t seem to find a solution for my problem.

I’ve made a Foe each workflow iterating through some PDF files in a folder, I can display the file path, but I can’t use it in my “Read PDF Text”, my assumption is that it doesn’t return the value including " ", så the filepath in “Read PDF Text” isn’t complete.

How can I solve this in the best way.

Hi @Michaeljep

It should work just as you have it, without the extra quotes :). Two questions then:

  1. What is the output variable of the Read PDF Text activity
  2. You say "I can’t use it in my “Read PDF Text”. Why? Is it because of an error or something else.
  3. Could you share this piece of workflow as a .xaml file? It would help to debug the issue.

I closed down the program and opened the xaml again, now it works. really don’t know why, nothing changed from my first tries.

But to answer, then you can say if my code is good :slight_smile:

  1. Output is “inputString” which is used in the assign "System.Text.Regular etc.)
  2. The message box “Faktnr” came out empty, that’s why I assumed that the filepath in “read PDF Text” was incorrect.

But maybe you can help with an other issue I have with the next assign;
In my assign I have this piece of code;
System.Text.RegularExpressions.Regex.Match(inputString,"(?<=KM).+ ").ToString
However it tends to return to many substrings, can I retrieve (x) chars after it has found the match, i.e match=KM - retrieve 1 substring but only one, or maybe match=KM - retrieve 10 characters?
When I run this assign I get this result
image
I’m only interested in the first substring.

Are the first characters always digits? If so, you could use this regex:

System.Text.RegularExpressions.Regex.Match(inputString,"(?<=KM)\d+").ToString

See how it works here.

If not, you can define how many characters you want to catch like that:

System.Text.RegularExpressions.Regex.Match(inputString,"(?<=KM).{4}").ToString

Fantastic, it works.

Thank you for the help.

1 Like