Array Utilities
Add, filter, sort, merge, and manipulate arrays
17 endpoints in this category. All require X-API-Key header.
Jump to:
Array Add Item
Array Combine
Array Contains
Array Count
Array Filter
Array Filter by Regex
Array Get Item
Array Merge
Array Remove Duplicates
Array Remove Item
Array Remove by Regex
Array Replace
Array Reverse
Array Sort
Array Split
Array to JSON
Array to XML
Array Add Item
POST
/api/ArrayAddItem
1 token
Add an item to an array.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Source array |
item |
string | required | Item to add |
position |
number | optional | Index to insert at |
Request Example
JSON
{"array": ["a", "b", "c"], "item": "d"}
Response Example
JSON
{"result": ["a", "b", "c", "d"], "count": 4}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayAddItem" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": ["a", "b", "c"], "item": "d"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [""a"", ""b"", ""c""], ""item"": ""d""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayAddItem", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayAddItem"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": ["a", "b", "c"], "item": "d"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayAddItem
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ "a",
│ "b",
│ "c"
│ ],
│ "item": "d"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayAddItem"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Combine
POST
/api/ArrayCombine
1 token
Combine two arrays into an object (keys + values).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array1 |
array | required | Array of keys |
array2 |
array | required | Array of values |
Request Example
JSON
{"array1": ["name", "age"], "array2": ["John", 30]}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayCombine" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array1": ["name", "age"], "array2": ["John", 30]}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array1"": [""name"", ""age""], ""array2"": [""John"", 30]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayCombine", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayCombine"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array1": ["name", "age"], "array2": ["John", 30]}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayCombine
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array1": [
│ "name",
│ "age"
│ ],
│ "array2": [
│ "John",
│ 30
│ ]
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayCombine"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Contains
POST
/api/ArrayContains
1 token
Check if array contains a value.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array to search |
value |
string | required | Value to find |
caseSensitive |
boolean | optional |
Case-sensitive
(default: true)
|
Request Example
JSON
{"array": ["Apple", "Banana"], "value": "banana", "caseSensitive": false}
Response Example
JSON
{"contains": true, "index": 1}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayContains" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": ["Apple", "Banana"], "value": "banana", "caseSensitive": false}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [""Apple"", ""Banana""], ""value"": ""banana"", ""caseSensitive"": false}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayContains", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayContains"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": ["Apple", "Banana"], "value": "banana", "caseSensitive": false}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayContains
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ "Apple",
│ "Banana"
│ ],
│ "value": "banana",
│ "caseSensitive": false
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayContains"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Count
POST
/api/ArrayCount
1 token
Count items in an array.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array to count |
Request Example
JSON
{"array": [1, 2, 3, 4, 5]}
Response Example
JSON
{"count": 5}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayCount" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": [1, 2, 3, 4, 5]}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [1, 2, 3, 4, 5]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayCount", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayCount"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": [1, 2, 3, 4, 5]}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayCount
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ 1,
│ 2,
│ 3,
│ 4,
│ 5
│ ]
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayCount"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Filter
POST
/api/ArrayFilter
1 token
Filter array by condition.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array to filter |
field |
string | required | Field to check |
operator |
string | required | equals, contains, startsWith, gt, lt |
value |
string | required | Value to match |
Request Example
JSON
{"array": [{"name": "apple"}, {"name": "banana"}], "field": "name", "operator": "startsWith", "value": "ap"}
Response Example
JSON
{"result": [{"name": "apple"}], "count": 1}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayFilter" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": [{"name": "apple"}, {"name": "banana"}], "field": "name", "operator": "startsWith", "value": "ap"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [{""name"": ""apple""}, {""name"": ""banana""}], ""field"": ""name"", ""operator"": ""startsWith"", ""value"": ""ap""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayFilter", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayFilter"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": [{"name": "apple"}, {"name": "banana"}], "field": "name", "operator": "startsWith", "value": "ap"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayFilter
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ {
│ "name": "apple"
│ },
│ {
│ "name": "banana"
│ }
│ ],
│ "field": "name",
│ "operator": "startsWith",
│ "value": "ap"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayFilter"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Filter by Regex
POST
/api/ArrayFilterRegex
1 token
Filter array items using regex.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array of strings |
pattern |
string | required | Regex pattern |
invert |
boolean | optional |
Return non-matching
(default: false)
|
Request Example
JSON
{"array": ["apple", "banana", "avocado"], "pattern": "^a"}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayFilterRegex" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": ["apple", "banana", "avocado"], "pattern": "^a"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [""apple"", ""banana"", ""avocado""], ""pattern"": ""^a""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayFilterRegex", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayFilterRegex"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": ["apple", "banana", "avocado"], "pattern": "^a"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayFilterRegex
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ "apple",
│ "banana",
│ "avocado"
│ ],
│ "pattern": "^a"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayFilterRegex"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Get Item
POST
/api/ArrayGetItem
1 token
Get item by index.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Source array |
index |
number | required | Zero-based index (-1 for last) |
Request Example
JSON
{"array": ["first", "second", "third"], "index": -1}
Response Example
JSON
{"item": "third"}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayGetItem" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": ["first", "second", "third"], "index": -1}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [""first"", ""second"", ""third""], ""index"": -1}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayGetItem", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayGetItem"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": ["first", "second", "third"], "index": -1}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayGetItem
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ "first",
│ "second",
│ "third"
│ ],
│ "index": -1
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayGetItem"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Merge
POST
/api/ArrayMerge
1 token
Merge multiple arrays.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
arrays |
array | required | Array of arrays |
unique |
boolean | optional |
Remove duplicates
(default: false)
|
Request Example
JSON
{"arrays": [[1, 2], [3, 4]], "unique": true}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayMerge" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"arrays": [[1, 2], [3, 4]], "unique": true}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""arrays"": [[1, 2], [3, 4]], ""unique"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayMerge", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayMerge"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"arrays": [[1, 2], [3, 4]], "unique": true}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayMerge
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "arrays": [
│ [
│ 1,
│ 2
│ ],
│ [
│ 3,
│ 4
│ ]
│ ],
│ "unique": true
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayMerge"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Remove Duplicates
POST
/api/ArrayRemoveDuplicates
1 token
Remove duplicate values.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array with duplicates |
Request Example
JSON
{"array": ["a", "b", "a", "c", "b"]}
Response Example
JSON
{"result": ["a", "b", "c"], "removed": 2}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayRemoveDuplicates" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": ["a", "b", "a", "c", "b"]}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [""a"", ""b"", ""a"", ""c"", ""b""]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayRemoveDuplicates", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayRemoveDuplicates"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": ["a", "b", "a", "c", "b"]}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayRemoveDuplicates
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ "a",
│ "b",
│ "a",
│ "c",
│ "b"
│ ]
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayRemoveDuplicates"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Remove Item
POST
/api/ArrayRemoveItem
1 token
Remove items by value.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Source array |
value |
string | required | Value to remove |
all |
boolean | optional |
Remove all occurrences
(default: true)
|
Request Example
JSON
{"array": [1, 2, 3, 2, 4], "value": 2}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayRemoveItem" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": [1, 2, 3, 2, 4], "value": 2}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [1, 2, 3, 2, 4], ""value"": 2}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayRemoveItem", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayRemoveItem"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": [1, 2, 3, 2, 4], "value": 2}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayRemoveItem
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ 1,
│ 2,
│ 3,
│ 2,
│ 4
│ ],
│ "value": 2
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayRemoveItem"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Remove by Regex
POST
/api/ArrayRemoveRegex
1 token
Remove items matching regex.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array of strings |
pattern |
string | required | Regex pattern |
Request Example
JSON
{"array": ["apple", "banana", "avocado"], "pattern": "^a"}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayRemoveRegex" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": ["apple", "banana", "avocado"], "pattern": "^a"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [""apple"", ""banana"", ""avocado""], ""pattern"": ""^a""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayRemoveRegex", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayRemoveRegex"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": ["apple", "banana", "avocado"], "pattern": "^a"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayRemoveRegex
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ "apple",
│ "banana",
│ "avocado"
│ ],
│ "pattern": "^a"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayRemoveRegex"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Replace
POST
/api/ArrayReplace
1 token
Replace values in an array.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Source array |
find |
string | required | Value to find |
replace |
string | required | Replacement value |
Request Example
JSON
{"array": ["hello", "world", "hello"], "find": "hello", "replace": "hi"}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayReplace" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": ["hello", "world", "hello"], "find": "hello", "replace": "hi"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [""hello"", ""world"", ""hello""], ""find"": ""hello"", ""replace"": ""hi""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayReplace", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayReplace"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": ["hello", "world", "hello"], "find": "hello", "replace": "hi"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayReplace
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ "hello",
│ "world",
│ "hello"
│ ],
│ "find": "hello",
│ "replace": "hi"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayReplace"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Reverse
POST
/api/ArrayReverse
1 token
Reverse array order.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array to reverse |
Request Example
JSON
{"array": [1, 2, 3, 4, 5]}
Response Example
JSON
{"result": [5, 4, 3, 2, 1]}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayReverse" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": [1, 2, 3, 4, 5]}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [1, 2, 3, 4, 5]}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayReverse", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayReverse"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": [1, 2, 3, 4, 5]}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayReverse
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ 1,
│ 2,
│ 3,
│ 4,
│ 5
│ ]
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayReverse"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Sort
POST
/api/ArraySort
1 token
Sort an array.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array to sort |
direction |
string | optional |
asc or desc
(default: asc)
|
key |
string | optional | Property name for objects |
Request Example
JSON
{"array": [3, 1, 4, 1, 5, 9], "direction": "asc"}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArraySort" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": [3, 1, 4, 1, 5, 9], "direction": "asc"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [3, 1, 4, 1, 5, 9], ""direction"": ""asc""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArraySort", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArraySort"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": [3, 1, 4, 1, 5, 9], "direction": "asc"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArraySort
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ 3,
│ 1,
│ 4,
│ 1,
│ 5,
│ 9
│ ],
│ "direction": "asc"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArraySort"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray Split
POST
/api/ArraySplit
1 token
Split array into chunks.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array to split |
chunkSize |
number | required | Chunk size |
Request Example
JSON
{"array": [1, 2, 3, 4, 5, 6, 7, 8, 9], "chunkSize": 3}
Response Example
JSON
{"chunks": [[1, 2, 3], [4, 5, 6], [7, 8, 9]], "count": 3}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArraySplit" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": [1, 2, 3, 4, 5, 6, 7, 8, 9], "chunkSize": 3}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [1, 2, 3, 4, 5, 6, 7, 8, 9], ""chunkSize"": 3}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArraySplit", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArraySplit"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": [1, 2, 3, 4, 5, 6, 7, 8, 9], "chunkSize": 3}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArraySplit
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ 1,
│ 2,
│ 3,
│ 4,
│ 5,
│ 6,
│ 7,
│ 8,
│ 9
│ ],
│ "chunkSize": 3
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArraySplit"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray to JSON
POST
/api/ArrayToJson
1 token
Convert array to JSON string.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array to convert |
pretty |
boolean | optional |
Pretty-print
(default: false)
|
Request Example
JSON
{"array": [{"name": "John"}], "pretty": true}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayToJson" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": [{"name": "John"}], "pretty": true}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [{""name"": ""John""}], ""pretty"": true}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayToJson", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayToJson"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": [{"name": "John"}], "pretty": true}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayToJson
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ {
│ "name": "John"
│ }
│ ],
│ "pretty": true
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayToJson"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as neededArray to XML
POST
/api/ArrayToXml
1 token
Convert array to XML.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
array |
array | required | Array to convert |
rootName |
string | optional |
Root element name
(default: items)
|
itemName |
string | optional |
Item element name
(default: item)
|
Request Example
JSON
{"array": ["apple", "banana"], "rootName": "fruits", "itemName": "fruit"}
Code Examples
curl -X POST "https://docbutterfly.com/api/ArrayToXml" \
-H "X-API-Key: df_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"array": ["apple", "banana"], "rootName": "fruits", "itemName": "fruit"}'using var client = new HttpClient();
client.DefaultRequestHeaders.Add("X-API-Key", "df_your_api_key_here");
var json = @"{""array"": [""apple"", ""banana""], ""rootName"": ""fruits"", ""itemName"": ""fruit""}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://docbutterfly.com/api/ArrayToXml", content);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);import requests
import json
url = "https://docbutterfly.com/api/ArrayToXml"
headers = {
"X-API-Key": "df_your_api_key_here",
"Content-Type": "application/json"
}
payload = json.loads('{"array": ["apple", "banana"], "rootName": "fruits", "itemName": "fruit"}')
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
data = response.json()
print(json.dumps(data, indent=2))┌─────────────────────────────────────────────┐
│ Power Automate - HTTP Action │
├─────────────────────────────────────────────┤
│ │
│ Method: POST │
│ URI: https://docbutterfly.com/api/ArrayToXml
│ │
│ Headers: │
│ X-API-Key: df_your_api_key_here │
│ Content-Type: application/json │
│ │
│ Body: │
│ {
│ "array": [
│ "apple",
│ "banana"
│ ],
│ "rootName": "fruits",
│ "itemName": "fruit"
│ }
│ │
└─────────────────────────────────────────────┘
Steps:
1. Add an HTTP action to your flow
2. Set Method to "POST"
3. Set URI to "https://docbutterfly.com/api/ArrayToXml"
4. Add the headers shown above
5. Paste the Body JSON into the Body field
6. Replace placeholder values with dynamic content as needed