HTTP Request body - retrieving form data and supplying it to the body

I have success with the below static body in the http request. But I can’t figure out how submit variables instead of the static values. I have tried some variations based on the AI bot, forum discussions and documentation.

{“accountName”:“jsmith”,“data”:{},“email":"[email protected]”,“endDate”:“2024-09-24T00:00:00-05:00”,“firstName”:“John”,“lastName”:“Smith”,“manager”:“Fred.Patterson”,“phone”:“800-858-4000”,“sourceId”:“57580fe1343e4ff5a9f888e751544f09”,“startDate”:“2020-03-24T00:00:00-05:00”}

My most recent attempt is:

{“accountName”:“${trigger.formData.assetNumber}”,“data”:{},“email”: “[email protected]’”,“endDate”:“2024-09-24T00:00:00-05:00”,“firstName”:“${trigger.formData.deviceType}”,“lastName”:“${trigger.formData.departmentName}”,“manager”:“Tim.Patterson”,“phone”:“800-858-4000”,“sourceId”:“57580fe1343e4ff5a9f888e751544f09”,“startDate”:“2020-03-24T00:00:00-05:00”}

This doesn’t fail the request, but it doesn’t substitute the variables.

Hi @ts_fpatterson ,

Can you try using the reference to formData elements as :

{{$.trigger.formData.assetNumber}}

So your request would be:

{
  "accountName": "{{$.trigger.formData.assetNumber}}",
  "data": {},
  "email": "[email protected]’",
  "endDate": "2024-09-24T00:00:00-05:00",
  "firstName": "{{$.trigger.formData.deviceType}}",
  "lastName": "{{$.trigger.formData.departmentName}}",
  "manager": "Tim.Patterson",
  "phone": "800-858-4000",
  "sourceId": "57580fe1343e4ff5a9f888e751544f09",
  "startDate": "2020-03-24T00:00:00-05:00"
}
1 Like

Thank you, this worked.

1 Like

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