How do i parse?

{"BOOKS": [{"uuid": "9e38b5bf8ddf4081aaecc74e1148ab74", "name": null, "refNo": 1, "duration": {"value": 0, "units": "unlimited"}, "isActive": true, "isExpired": false, "isUpgrading": false, "isDowngrading": false, "isStarted": true, "isGracePeriod": false, "isAutorenewable": false, "isResumable": false, "isSuspendable": true, "isPostPaid": false, "isLimited": true, "isSuspended": false, "isBusiness": false, "isMovable": false, "isHidden": false, "isNfr": true, "isBeta": false, "isPromo": false, "storeId": "custom", "storeLastTransactionState": "payment_received", "isSellOptionApplicable": true, "nextBillingCost": null, "nextBillingCostCurrency": "", "canRenewOnline": true, "activatedAt": "2018-08-21", "nextBillingAt": null, "lastBillingAt": "2019-08-21", "mainPeriodEndsAt": null, "gracePeriodEndsAt": null, "plannedDowngradeAt": null, "universalKeys": [{"key": "1234", "is_blacklisted": false, "quota": 1, "used": 0, "vacant": 1}], "licensedProducts": [{"keyName": "pdfm14", "productName": "Book1", "productKeyName": "pdfm", "subsetAllowed": false, "description": "Book Desktop", "is_main_resource": true, "is_primary_resource": false, "licenses": {"objectType": "host", "thisPeriod": 1, "nextPeriod": 1, "usage": 0, "available": 1, "limit": 1, "total_usage": 0, "total_available": 1, "total_reserved_usage": 0, "total_dynamic_usage": 0, "reserved": 0, "ratio": 1, "modification": null}}], "storeProducts": [{"details": {"ext_key": "CUSTOM_UPGRADE"}, "amount": 1}], "canAddLicense": false, "canUpgradeOnline": false, "isLicenseManager": true, "isExternalBundle": false, "payment_options_url": "", "salesForce": {"hasContract": false}}, {"uuid": "ee5374ec9974484d981cb5916de7b68c", "name": null, "refNo": 2, "duration": {"value": 0, "units": "unlimited"}, "isActive": true, "isExpired": false, "isUpgrading": false, "isDowngrading": false, "isStarted": true, "isGracePeriod": false, "isAutorenewable": false, "isResumable": false, "isSuspendable": true, "isPostPaid": false, "isLimited": true, "isSuspended": false, "isBusiness": false, "isMovable": false, "isHidden": false, "isNfr": false, "isBeta": false, "isPromo": false, "storeId": "cb", "storeLastTransactionState": "payment_received", "isSellOptionApplicable": true, "nextBillingCost": null, "nextBillingCostCurrency": "", "canRenewOnline": true, "activatedAt": "2018-07-31", "nextBillingAt": null, "lastBillingAt": null, "mainPeriodEndsAt": "2020-07-31", "gracePeriodEndsAt": null, "plannedDowngradeAt": null, "universalKeys": [{"key": "1234", "is_blacklisted": false, "quota": 1, "used": 1, "vacant": 0}], "licensedProducts": [{"keyName": "pdfm13", "productName": "Book2", "productKeyName": "pdfm", "subsetAllowed": false, "description": "Book", "is_main_resource": true, "is_primary_resource": true, "licenses": {"objectType": "host", "thisPeriod": 1, "nextPeriod": 1, "usage": 1, "available": 0, "limit": 1, "total_usage": 1, "total_available": 0, "total_reserved_usage": 0, "total_dynamic_usage": 0, "reserved": 0, "ratio": 1, "modification": null}}, {"keyName": "ptb_basic", "productName": "Book Toolbox", "productKeyName": "ptb", "subsetAllowed": false, "description": "Book Toolbox", "is_main_resource": true, "is_primary_resource": false, "licenses": {"objectType": "host", "thisPeriod": 1, "nextPeriod": 1, "usage": 1, "available": 0, "limit": 1, "total_usage": 1, "total_available": 0, "total_reserved_usage": 0, "total_dynamic_usage": 0, "reserved": 0, "ratio": 1, "modification": null}}], "storeProducts": [{"details": {"ext_key": "203037"}, "amount": 1}], "canAddLicense": false, "canUpgradeOnline": false, "isLicenseManager": true, "isExternalBundle": false, "payment_options_url": null, "salesForce": {"hasContract": false}}, {"uuid": "dad8121c08834e3c840dfa099330b779", "name": null, "refNo": 3, "duration": {"value": 1, "units": "years"}, "isActive": false, "isExpired": true, "isUpgrading": false, "isDowngrading": false, "isStarted": true, "isGracePeriod": false, "isAutorenewable": false, "isResumable": false, "isSuspendable": false, "isPostPaid": false, "isLimited": true, "isSuspended": false, "isBusiness": false, "isMovable": false, "isHidden": false, "isNfr": false, "isBeta": false, "isPromo": false, "storeId": "custom", "storeLastTransactionState": "payment_received", "isSellOptionApplicable": true, "nextBillingCost": null, "nextBillingCostCurrency": "", "canRenewOnline": true, "activatedAt": "2018-08-21", "nextBillingAt": null, "lastBillingAt": null, "mainPeriodEndsAt": null, "gracePeriodEndsAt": "2019-08-28", "plannedDowngradeAt": null, "universalKeys": [{"key": "123123", "is_blacklisted": false, "quota": 1, "used": 0, "vacant": 1}], "licensedProducts": [{"keyName": "book_subscription", "productName": "Book Toolbox2", "productKeyName": "ptb", "subsetAllowed": false, "description": "Book Toolbox", "is_main_resource": true, "is_primary_resource": true, "licenses": {"objectType": "host", "thisPeriod": 1, "nextPeriod": 1, "usage": 0, "available": 1, "limit": 1, "total_usage": 0, "total_available": 1, "total_reserved_usage": 0, "total_dynamic_usage": 0, "reserved": 0, "ratio": 1, "modification": null}}], "storeProducts": [{"details": {"ext_key": "SUB-1Y"}, "amount": 1}], "canAddLicense": false, "canUpgradeOnline": false, "isLicenseManager": true, "isExternalBundle": false, "payment_options_url": "", "salesForce": {"hasContract": false}}]}

Hello, I have a json that I need to parse like this, the only thing I want to parse here is “lastBillingAt”, but if its value is “null”, that is, if it does not exist, I need to get the value of “mainPeriodEndsAt” and if it does not exist, I need to get the value of “gracePeriodEndsA”. Of course, I need to take them as “RECURSIVE” and then combine them with the values ​​I got from “description” without losing their order.

BLOCK:Parse
  input = @data.SOURCE
  prefix = "Product Name = "
  suffix = " - "
  jToken = "$..BOOKS[*].licensedProducts[*].description"
  RECURSIVE
  MODE:Json
  => VAR @Description
ENDBLOCK

BLOCK:Parse
  input = @data.SOURCE
  prefix = "Last Biling = "
  jToken = "$..BOOKS[*].lastBillingAt"
  RECURSIVE
  MODE:Json
  => VAR @LastBiling
ENDBLOCK

BLOCK:ZipLists
  list1 = @Description
  list2 = @LastBiling
  => VAR @List
ENDBLOCK

If everything had gone well it would have been like this

TRY THIS

BLOCK:Parse
  input = @data.SOURCE
  jToken = "$.BOOKS[*].lastBillingAt"
  RECURSIVE
  MODE:Json
  => VAR @parseOutput
ENDBLOCK

POC :