Skip to main content

Hi ,

 

Im trying to find out a  easy way solution for string extraction. 

Example: 1. Im unable to connect to VPN in the Org

  1. The VPN is not connecting 

so here the sentence will be different but i need to check the VPN word is there or not (for this i used if condition ).. and i need to extract that VPN word alone from the dynamic sentence.

Can someone help me out to fix this?

 

Thanks in advance !

 

One of the easiest ways to do this is to use the IF action, based from a string variable, and see if it “includes” (or I like to call it “contains”) the word “VPN”.


Yes i used that ..after finding the availability of word i need to extract that specific word alone. 

Since the bot will be handling large data i need to fix for different other cases as well 

 


Maybe I don’t understand, but if the IF action detects that the word “VPN” is present, why would you need to extract it? You know it’s there.

OTOH: You can use the String: Find action to extract the position of the word “VPN” in the sentence then a String: Substring… but again, check to make sure you really need that.


i tried this though but for somecases the expected output is coming but for some cases not 


The actions themselves won’t give inconsistent results, so I might suggest running your automation in Debug mode and inspecting the values of the variables in real time.

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/working-with-automation-tasks/cloud-enabling-the-debugging-option.html


After using action IF (String condition), and assign your source dynamic variable, and use “includes”, then the string value “VPN”, inside this IF condition, use String FIND from the string action package, then use the source string “as your dynamic variable that contains VPN”, and in the “FIND STRING” write VPN. this will extract the word “VPN” alone from your dynamic variable. and save the output to a new variable


Even easier:
If ($stringvariable include “VPN”)
    String: Assign $resultstring = “VPN”

You already know $stringvariable contains “VPN”, so why even bother with trying to isolate the word VPN? You’re doing more work than necessary to get the same effect.   :)


Reply