How to Manage String

Hi to all,
following a scraping on a web page, I extract a table of this type:

[{“NE__Value__c”:null,“Name”:“MSISDN”}]
[{“NE__Value__c”:“3700000000”,“Name”:“MSISDN”}]
[{“NE__Value__c”:“3700000001”,“Name”:“MSISDN”}]

for each row of this table, I must detect and assign the “number” as a variable where present.

In the first line, where the field is “null”, I would like to assign to the variable, the word “null” or “empty” or directly the number 0.
For the other lines, the variable must be = to the number present: 3700000000 and 3700000001…

Can anyone help me with this?

thanks
Aaron

Hi @AaronMark

You can handle with If condition

Condition → Row(“Number”).tostring.Contains(“null”) Or Row(“Number”).tostring.Contains(“empty”)

Then part
Use Assign activity
LHS → Number (Variable)
RHS → 0

Else part
Use Assign activity
LHS → Number (Variable)
RHS → Row(“Number”).tostring

Regards
Gokul

Before using this logic, I need to split the cell text to pick up the number that is in the center.

image
This is the scraping output

Hi @AaronMark

You can try with Regex expression in it

Use Assign activity

LSH - OutputReg (Assign an variable)
RHS - System.Text.RegularExpressions.Regex.Match(Row("Column-8"),"(?s)c”:“(.*?)”|(?s)c”:(.*?),").tostring

After this expression you can go ahead

Regards
Gokul

Hi @AaronMark,

I would solve it through the regex. First I would take the cell input if its contain any number, than it will take the number, otherwise it will be empty. See my screenshots.

In properties you can see the pattern which will match the number and output is boolean

Some problem in the string …
image

WoW doceluch

I don’t know what you did …
but you did it right !!

It Works!!
top!!

1 Like

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