I’m creating a robot which required to change the amount in a system, based on a request which will be received from 3rd party. There are several type of request (as shown below) that will be received
Request type possibilities:
“32 EUR”
“INR 48.2”
“Please change the cash amount to 87 SGD”
“Please change from 28 MYR to 52.7 ROL”
Basically, I want the robot to strip out currency and the amount only to a variable.
@Serran_Neru You need a design for this robot. I will give some outline design as follows:
capture all received inputs to change system in a note pad (later you can create a live template to capture them) depends of your system where you receive the data(from 3rd party).
Read note pad line by line into a string.
each line will have numbers for respective currency. please use string manipulations like split, trim, right, left functions and get your desired values from the string.
invoke your local system to post grabbed data.
If you spend some time on this forum search you can find WF for reading a note pad line by line. You also can get string manipulations in this forum…
above steps will be useful to create a WF to read text file line by line.
First Create a list of strings of currencies of different nations let us take ListA
ListA={“EUR”,“INR”,“SGD”,“MYR”,“ROL”}.ToList()
Let’s take stra=“Please change the cash amount to 87 SGD
ListB=stra.Split({" "},stringSplitOptions.RemoveEmptyEntries).ToList.Where(Function(Item) **
** IsNumeric(Item) or ListA.Contains(Item.ToUpper)).To List()
Now Your Required Output Will Be
StrOutput=string.join(" ",ListB)
I think you copied the ** from the code what i have posted in forum, thats just used for Highlight the code
Now use the below code
ListB=stra.Split({" "},stringSplitOptions.RemoveEmptyEntries).ToList.Where(Function(Item)
IsNumeric(Item) or ListA.Contains(Item.ToUpper)).To List()
List A and List B are not array of strings , they are List of strings
TO select the List Of strings In Variable type select Browse and type List, In list select for strings List
After creating ListA of type ListA use the below syntax
ListA={“EUR”,“INR”,“SGD”,“MYR”,“ROL”}.ToList
Or Instead try removing .ToList at Last and give .ToArray
For me it’s working fine. I have already tested the code.
I think the issue is with double coats,Try once by deleting and adding double coats inside flower bracket