Find specific text in Collection Object

Objective is to find or search specific text ‘invoices’ in collection (7) (output of invoke PowerShell activity)

Not sure whether specific text will come in collection object(0), (2) or (5). I’ve also tried using CollectionOutput.contains(“invoices”) but getting false output instead of true value.

Hi @Sonalk
Can u give more idea about the variables which u are using etc

Regards,
Nived N

Hi @NIVED_NAMBIAR - find the attached Powershell command output. Objective is to find this text ‘the sender’s address contains these words: ‘travelctm’’ as Output(3).contains(“travelctm”) doesn’t work in Collection.

PSOutput.txt (5.4 KB)

I’m thinking to use For Each and then extract values to put logic.

Hi @Sonalk
Are u getting this text value when u call this in uipath via invoke powershell activity?

@NIVED_NAMBIAR : this output is not in string format. It is actually in Collection format.

I tried extracting values using Output(0).ToString, Output(1).ToString etc but not able to find text in this way : Output(0).ToString.contains(“specified text”).

  • do following for analysis purpose
  • set a breakpoint after you retrieved the Collection with Output objects
  • debug, get paused with breakpoint
  • open immediate panel
    type in Output(0)
    and share the result with us (e.g. screenshot)
    Also try next statements:
    Output(0).getType()

@ppr : Please find the screenshot.

image