• krishna casukhela 15
  • NEWBIE
  • 10 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 1
    Replies
I have an api response as follows
[
  {
    "providerInfo": {
      "pcd_eligible": false,
      "tiered_plan": true,
      "tiers": {
        "provider_tier": 2,
        "benefit_tier": 2
      }
    },
"providerInfo": {
      "pcd_eligible": false,
      "tiered_plan": true,
      "tiers": {
        "provider_tier": 1,
        "benefit_tier": 1
      }
    }
]
After reading the response, if provider_tier = 1, then I want to change the api response as provider_tier = "Maximum"
similarly if provider_tier = 2, then I want to change the api response as provider_tier = "Standard"

so api response after changes will look like this
providerInfo": {
      "pcd_eligible": false,
      "tiered_plan": true,
      "tiers": {
        "provider_tier": "Maximum",
        "benefit_tier": 1
      }
    }
var providerList = component.get("v.providerList");
variable providerList will have the initial api response.
for(var list=0;list<providerList.length;list++){
if(providerList[list].providerInfo.tiers.provider_tier.toString() === 1){
                    providerList[list].providerInfo.tiers.provider_tier = 'Maximum';
            }
            else if(providerList[list].providerInfo.tiers.provider_tier.toString() === 2){
                    providerList[list].providerInfo.tiers.provider_tier = "Standard";
}
But I am unable to change api field values. Please let me know how to achieve this.

krishna
I have an javascript array in lightning component controller.
var networkIds=[];
after some logic I have as follows inside the array "NetworkID":"11320"
I want to extract the number "11320" and then store it in attribute of type string..
I am doing as follows: var networkid=networkIds[0].split(':');
But I am getting an error
can any one pls let me know.

thanks
Krishna
I am currently doing business specialist super badge trailhead and I imported the rows using data import wizard .

when I click Check Challenge I am getting the following error

error screenshot

The package is already installed in TrailHead Playground1 but still I am facing an issue.

Anybody who has worked on this badge do please let me know how to complete challenge 1.

I have added "Residentail" and "Other" to the account Type picklist and activated it.

I have given 2 rows of the CSV file for understanding purpose.
Account NameTypeRatingBilling State/ProvinceAccount PhonewebsiteBilling CityBilling Zip/Postal CodeAnnual Revenue
Sam Heath Household  ResidentialHotNM1.23E+09https://twitter.com/trailheadOdessa9411445000
Imran Pope Household  OtherMedium CO3.46E+09https://twitter.com/salesforceDenver8020670000


 
I am currently doing business specialist super badge trailhead and I imported the rows using data import wizard .

when I click Check Challenge I am getting the following error

error screenshot

The package is already installed in TrailHead Playground1 but still I am facing an issue.

Anybody who has worked on this badge do please let me know how to complete challenge 1.

I have added "Residentail" and "Other" to the account Type picklist and activated it.

I have given 2 rows of the CSV file for understanding purpose.
Account NameTypeRatingBilling State/ProvinceAccount PhonewebsiteBilling CityBilling Zip/Postal CodeAnnual Revenue
Sam Heath Household  ResidentialHotNM1.23E+09https://twitter.com/trailheadOdessa9411445000
Imran Pope Household  OtherMedium CO3.46E+09https://twitter.com/salesforceDenver8020670000