Skip to main content
Solved

how to set json input  arc script

  • June 6, 2025
  • 2 replies
  • 79 views

Forum|alt.badge.img

<arc:set attr="input.uri" value="[FilePath]"/>
<arc:call op="xmlOpen" input="input">
  <arc:set attr="xml.handle" value="[handle]" />
</arc:call>
<arc:set attr="xml.map:lastupdate" value="/Items/gtm_req_pr_details_ib_pr/lastupdate"/>
<arc:set attr="xml.map:till_date"     value="/Items/gtm_req_pr_details_ib_pr/till_date"/>

<arc:try>
  <arc:call op="xmlDOMGet" in="xml" out="out1">
    <arc:set attr="data.lastupdate" value="[out1.lastupdate]"/>
    <arc:set attr="data.till_date"     value="[out1.till_date]"/>
  </arc:call>
  <arc:set attr="http.URL" value="https://api.com/purchaserequisitions?approvalLeftDate=[data.lastupdate]&approvalRightDate=[data.till_date]" />  
<arc:set attr="http.header:name#" value="X-AUTH-TOKEN" />
<arc:set attr="http.header:value#" value="xcxcxcxcdxcxcccccccc"/>
<arc:set attr="http.header:name#" value="email" />
<arc:set attr="http.header:value#" value="[email protected]"/>

<arc:call op="httpPost" in="http">
  <arc:set attr="output.data" value="josninput how" />
</arc:call>

<arc:set attr="output.filename" value="dh-fetch-order-[data.till_date].json" />
<arc:push item="output" /> 
  <arc:finally>
    <arc:call op="xmlClose" input="xml"/>
  </arc:finally>
</arc:try><!-- NOTE: Do not edit arc:info →


<arc:call op="httpPost" in="http">
  <arc:set attr="output.data" value="josninput how" />
</arc:call>  how to set json input 

 

Best answer by James B

It is hard to understand the question being asked here, but assuming this question is how to pass the HTTP response from the post to the output content, you’ll find that the http:content output parameter to the operation is what you are looking for

httpPost help:

 

<arc:call op="httpPost" in="http">
  <arc:set attr="output.data" value="[http:content]" />
</arc:call>

 

This topic has been closed for replies.

2 replies

lohith
  • Employee
  • June 10, 2025

Hi,

What exactly the Json input you are referring to? Is it the response from the Post call? We have complete doc on HttpPost defined at https://cdn.cdata.com/help/AZM/mft/op_HTTPPost.html this might help. However, please send the additional details to [email protected], so that we will have ticket and track it better.

 


James B
Forum|alt.badge.img
  • Employee
  • Answer
  • June 10, 2025

It is hard to understand the question being asked here, but assuming this question is how to pass the HTTP response from the post to the output content, you’ll find that the http:content output parameter to the operation is what you are looking for

httpPost help:

 

<arc:call op="httpPost" in="http">
  <arc:set attr="output.data" value="[http:content]" />
</arc:call>