Call Rest Post upon approval

On hitting the approval button, I want to pull information from a page, form an JSON object can call a Rest POST method.

I have been searching for almost a week and still have not found a solution.

Hi @HuyP17171115

Would you kindly provide some details so I can better understand what you need

Thanks,

Prasad

@prasadreddyM16651450

This is my first time using Pega, so my terminology might be off.

I have a dispute form with account number. On the last page before closing the dispute, I want to pull that account number from the first page, and submit it via REST POST method when I hit the approval button.

Hi @HuyP17171115

  • First you check where the account number is present in the clipboard.
  • Copy respective value from clipboard to a parameter.
  • On click of Approval button call the REST connector datapage and pass this param value (or)
  • If you want to pass the JSON object then convert your respective clipboard page property(Page which contains the respective property) into JSON object by using the function @(Pega-Rules:pages).pxConvertPageToString(tools,mysteppage,‘json’,‘true’) and map this JSON in request data transform.

@HuyP17171115

On the click of approve, you can call a REST connector that you should have already mane before. The best was to do it is via a data page with source connector. You can refer the data page in the data transform on the button action, on the on the post-processing action of the flow action, depending on your design.

The details of the data that you need send in the REST will be present in your clipboard, you need to map it in the request data transform of the data page, which you can pass as parameters from the data transform.