How to properly use Switch Activity with Contains

I’m extracting text from Invoice PDFs, saving it as a string.

I want to use a Switch (string) and the Contain command to find parts of the text.
This way in each case I want to invoke one of 6 different sequences, each configured for a specific type of invoice.

How should I do it?

Hi @Gabriel_Wisniewski ,

Check this thread :

I had used Contains in Switch. It will get you started. :slightly_smiling_face:

1 Like

Hi,

Hope the following helps you.

img20210429-1

keywords.Where(Function(s) yourString.Contains(s)).SingleOrDefault

or

keywords.Where(Function(s) yourString.Contains(s)).FirstOrDefault

Note: the above expressions have different behavior if there are 2 or more matches.

Regards,

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.