Sending a JSON-file as part of form-data in Web Request

Hi!

I have done something similar with an XML file once. It was done from a Service, but I believe the same should work in an App. Here are the steps (adjusted for the fact that you are producing a .json instead of a .XML file)

Step 1: Create File Object (action node)

  • Data Source: A runtime only data source (File Object Class) with cardinality one
  • Source Type: Custom
  • Custom File Content: a function returning the JSON structure as a string. E.g. return `{name: “Bob”}`
  • File Name: Myfile.json
  • Mime type: application/json

Step 2: Web Request (action node)

  • Method: POST
  • Body Type: Form Data
  • Body Content (example, this depends on the name of the fields the recipents has specified): Key: fil, Data Type: File, Value: My-file-datasource.File Content

Since the My-file-datasource is a runtime only datasource, the File Content property is in fact a blob (since it is not persisted, i.e. has no URL to refer)

1 Like