Need to extract specific data from JSON data

Hi below is the JSON string extracted from Deserialize JSON activity.

{
“applicationArea”: {
“internalTransactionId”: “6372895941531943”,
“task”: [
{
“taskName”: “DealDetails”,
“timeTaken”: 743
}
],
“totalTime”: 743
},
“responseStatus”: “SUCCESS”,
“messages”: ,
“dataArea”: {
“deal”: {
“optyDetails”: ,
“updatedTimeStamp”: “2023-11-06T12:06:25.779-0800”,
“rfpFlag”: “No”,
“pdrProdValue”: 0.0,
“pdrServValue”: 0.0,
“legacyFlag”: “N”,
“publishDiscountFlag”: “N”,
“p360DealFlag”: “N”,
“dealId”: “68486851”,
“dealName”: “test”,
“dealObjectId”: 4736664544,
“activeWorkflow”: “PDR”,
“dealExpBookDate”: “”,
“dealExpProductAmount”: 0.0,
“dealExpServiceAmount”: 0.0,
“dealTypeDesc”: “PDR Deal”,
“sfdcIntegration”: false,
“dealScope”: “Regular Deal”,
“dealScopeId”: 3,
“businessScenario”: “Single quote”,
“businessScenarioId”: 1,
“createrDetail”: {
“ccoId”: “kuchavan”,
“role”: “CS User”,
“paeUserId”: 1016796
},
“teamDetails”: [
{
“counter”: 0,
“accessGrantorId”: 1016796,
“memberId”: 1036311,
“ccoId”: “icw_user2_aus”,
“firstName”: “Brad”,
“lastName”: “Madison”,
“role”: “CS_USER_PARTNER_CONTACT”,
“memberAccessScope”: “DEAL”,
“memberVisibility”: “E”
},
{
“counter”: 0,
“accessGrantorId”: 1016796,
“memberId”: 1016796,
“cecId”: “kuchavan”,
“ccoId”: “kuchavan”,
“firstName”: “Kuldip Surendra”,
“lastName”: “Chavan”,
“role”: “CAM”,
“memberAccessScope”: “DEAL”,
“memberVisibility”: “IE”
}
],
“quotes”: [
{
“quotePartnerExtn”: [
{
“partnerBEGeoId”: 486531,
“createdForCountryCd”: “AUSTRALIA”,
“partnerSiteId”: 2587653,
“partnerBeGeoId”: 486531,
“beId”: 436411,
“createdForBeGeoId”: 486531,
“countryCD”: “AUSTRALIA”
}
],
“hrdFlag”: “N”,
“hrdPartnerExceptionFlag”: “false”,
“hrdEcExceptionFlag”: “false”,
“majorLineCnt”: 3,
“cocoQuote”: false,
“atOrBelowFlag”: “N”,
“sdgCustomerTechSelectFlag”: “N”,
“gdrFlag”: “Y”,
“crpFlag”: “N”,
“cbnSplitEligible”: “N”,
“distiException”: 0,
“gebCallRequired”: “Y”,
“cbnDistiId”: 1,
“finishState”: 0,
“federalFlg”: “N”,
“fetchedWsTaaPref”: “Y”,
“isDiscGuidanceViewed”: “N”,
“quoteStatusDesc”: “Not Submitted”,
“custOptInPreference”: “NoAnchor”,
“siteObjectId”: 5777962606,
“eaEligibleCheck”: “Y”,
“shipToCountry”: “US”,
“oaStatus”: “N”,
“updatedOn”: “2023-11-14T12:20:53.604-0800”,
“updatedBy”: “icw_user2_aus”,
“createdBy”: “kuchavan”,
“cbnStatusDesc”: “NOT ELIGIBLE”,

    }
}

}

I need to extract “quoteStatusDesc”.

Please let me know how to get it

Hey @shruthi_arali
“Quotes” is an array, you’ll need to access the first element (or the specific quote of interest) to get to “quoteStatusDesc”. You can try use this:
jsonObject("dataArea")("deal")("quotes")(0)("quoteStatusDesc").ToString

2 Likes

Hi @shruthi_arali
→ Use Deserialise Json and store the output in a variable say JObject.

Can you try the below syntax:

quoteStatusDesc= JObject.SelectToken("dataArea.deal.quotes[0].quoteStatusDesc").ToString()

Hope it helps!!

1 Like

@shruthi_arali

Step 1: Deserialize JSON

Use the Deserialize JSON activity to convert the JSON string into a JObject.

Step 2: Access the Value

Since the JSON structure is nested, you need to access the relevant properties to get the value of “quoteStatusDesc.” Use the following expression:

vbCopy code

JObject.Parse(yourJsonString)("dataArea")("quotes")(0)("quoteStatusDesc").ToString

Replace yourJsonString with the actual variable or expression containing your JSON string.

Step 3: Store the Result

Assign the extracted value to a variable or use it directly in your workflow.

1 Like

Hi @shruthi_arali

Try below expression in Assign Activity

jsonObject.SelectToken(“dataArea.deal.quotes[0].quoteStatusDesc”).ToString()

Happy Automation :slight_smile:
Cheers!!

1 Like

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