Skip to main content
Best answer

How do I inject input field values into the request body of an API call, for a custom app action?

  • May 3, 2026
  • 2 replies
  • 22 views

Forum|alt.badge.img+1

I’m configuring my API request with code rather than form. The from and to fields are expecting the date strings:

“2026-03-01”, “2026-03-31”

I tried this:

const options = {
  url: 'https://fakeurl.com/search',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json'
  },
  params: {

  },
  body: {
      data: {
        advanced_search: {
          per_page: 100,
          query: {
            $all: [
              {
                $all: [
                    {
                        $condition: {
                            attr: "CreatedAt",
                            ope: "range",
                            from: `"${bundle.inputData.start_date}"`,
                            to: `"${bundle.inputData.end_date}"`
                        }
                    }
                ]
              }
          }
        }
      }
  }
}

But the request fails. If I replace the $condition object with this:

                        $condition: {
                            attr: "CreatedAt",
                            ope: "range",
                            from: ”2026-03-01”,
                            to: "2026-03-31"
                        }

The request succeeds. When I’m using the input variables, they are entered as 2026-03-01 and 2026-03-31 respectively. They are string fields. So I must be accessing the input variables incorrectly. How do I fix this?

Note, I’m having trouble seeing what the resulting request body is. Adding z.console.log('Request body:', JSON.stringify(options.body, null, 2)); didn’t seem to result in any logs when I tested this action.

Best answer by BobbyA

This worked:
 

$condition: {
                            attr: "CreatedAt",
                            ope: "range",
                            from: bundle.inputData.start_date,
                            to: bundle.inputData.end_date
                        }


I think, because the input fields are marked as Strings, the quotations are automatically added around the values entered into those fields
 

 

2 replies

Forum|alt.badge.img+1
  • Author
  • Beginner
  • Answer
  • May 3, 2026

This worked:
 

$condition: {
                            attr: "CreatedAt",
                            ope: "range",
                            from: bundle.inputData.start_date,
                            to: bundle.inputData.end_date
                        }


I think, because the input fields are marked as Strings, the quotations are automatically added around the values entered into those fields
 

 


In a custom action, the key is making sure the input fields are referenced inside the perform/request body, not just defined in the inputFields section. I’d test with a very small JSON body first using two fields, confirm they appear in the request inspector, then expand to the full payload. Most failures here are either nesting mismatch or sending undefined fields.