Forum Discussion

vpachpute1's avatar
vpachpute1
Frequent Contributor
7 years ago
Solved

To send sub ID from prev response -1

Hi

 

I have one scenario.

 

In purchase, I get subscription-id in response. e.g. If my subscripton-id is 78, there is one more sub with id 77 in DB

 

So I have to pass sub-id as 77 for further actions. can you please let me know how to achieve this in Ready API 2.0

 

**************

<request>
  <freeze-sub>
      <msisdn>447717887733</msisdn>
      <subscription-id>${Preconsition - Puchase pAlt#ResponseAsXml}${Preconsition - Puchase #ResponseAsXml#//response[1]/subscription-id[1]}</subscription-id>
      <action>FREEZE</action>
    </freeze-sub>
</request>

*******************

Note: If usig thisfollowing, i gets sub-id as 782, then i have to send in request as 781

${Preconsition - Puchase pAlt#ResponseAsXml}${Preconsition - Puchase #ResponseAsXml#//response[1]/subscription-id[1]}

 

Can you please help me in this

 

Regards

Vishal

  • Please see if the below helps.

     

    <subscription-id>${= (${Preconsition - Puchase pAlt#ResponseAsXml}${Preconsition - Puchase #ResponseAsXml#//response[1]/subscription-id[1]} as Integer) -1}</subscription-id>

1 Reply

  • nmrao's avatar
    nmrao
    Champion Level 3

    Please see if the below helps.

     

    <subscription-id>${= (${Preconsition - Puchase pAlt#ResponseAsXml}${Preconsition - Puchase #ResponseAsXml#//response[1]/subscription-id[1]} as Integer) -1}</subscription-id>