AaronMark
(AaronMark)
June 15, 2022, 12:47pm
1
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
Gokul001
(Gokul Balaji)
June 15, 2022, 1:12pm
2
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
AaronMark
(AaronMark)
June 15, 2022, 1:21pm
3
Before using this logic, I need to split the cell text to pick up the number that is in the center.
This is the scraping output
Gokul001
(Gokul Balaji)
June 15, 2022, 1:28pm
4
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
doceluch
(Doceluch)
June 15, 2022, 1:29pm
5
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
AaronMark
(AaronMark)
June 15, 2022, 1:39pm
6
Some problem in the string …
AaronMark
(AaronMark)
June 15, 2022, 2:06pm
7
WoW doceluch
I don’t know what you did …
but you did it right !!
It Works!!
top!!
1 Like
system
(system)
Closed
June 18, 2022, 2:07pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.