Reduce Fetched the Data after API Input

Im fetching the phone number from an API. I recieve the number with countrycode. My form has the country code already set as constant.

For example: +91 6568983744

I need to input only 6568983744
But my fetch is 91 6568983744. Is it possible to exclude the first 2 digits in a simple way?

Im Using Studio X with HTML request. Fetching from json works great but i have to solve this issue.

Thank You…

Hii @sneha41

Try this

JSONOBJECT(“ActiveSystems”)(0)(“PhoneNumber”).ToString.SubString(2)

or

JSONOBJECT(“ActiveSystems”)(0)(“PhoneNumber”).ToString+“.”+JSONOBJECT(“ActiveSystems”)(0)(“PhoneNumber”).ToString.Split(" ")(1)

This is helpful for you
If anything error please let me know

Cheers…!

1 Like

@sneha41

Multiple ways

In every way you need to first deserialize the json using the related qctivity in webapi packages.let jobj is the output of deserialize json activity

  1. Jobj(“ActiveSystems”)(0)(“PhoneNumber”).ToString.Trim will give complete number…now use text to left/right activity and gice the seprator as " "(space)…then text to right of it is what you need
  2. Jobj("ActiveSystems")(0)("PhoneNumber").ToString.Trim.Split({" "},Stringsplitoptions.None)(1) use this is set variable activity with left side a string variavle and right as this formula

Here is you are having list of phone numbers and need to get each…then use for each activity with jobj("ActiveSystems") and inside the loop use currentItem("PhoneNumber").ToString and follow any of the above methods

Cheers

@Dilli_Reddy
Thank You Its working

Thank u for the reply @Anil_G

1 Like

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