Hello,
i have below json and i need to get value of scope and need to write in excel
i able to achieve this with below code
but some times scope is comming 2 or more than 2 times in jso like below , in that case i need to fetch first that value for scope and need to write in excel
and automation able to take both but it is writing in next iteration
how can i get in first iteration ?
help me on same
@Mathkar_kunal
Is that data in array? if yes then you can use like, currentjtoken(0)(“scope”).tostring
Hi @Mathkar_kunal
You’re getting multiple scope values, so UiPath is picking them in different iterations.
use this:
currentToken.SelectTokens(“scope”).First.ToString
Then write this value to Excel.
This will always pick only the first occurrence even if multiple scope values exist.
ok , but i need second as well and if contains more thn two as well in one itreation then how can i taek those? and ned to write in single line of excel
Use this:
String.Join(“,”, currentToken.SelectTokens(“scope”).Select(Function(x) x.ToString))
and one more point i am not able to understand is loop how randomply increasing by value 2?
it should take 601 after 600
can you show how you are writing data in excel
Hi @Mathkar_kunal
Could you please provide the required output and input..
Regards,
Pravallika
you can see script ss below.
it is prety simple script but still not writing please check
initially give the counter value is 1
counter is just to write in cell only, and it starts from b2 right so kept value 2