Skip to main content
Question

Troubleshooting Flattened JSON Data from Hivebrite API – How Can I Preserve Leading Empty Items?


Hi everyone,

I'm having trouble with my Hivebrite API integration in Zapier. I'm using the Hivebrite Admin API endpoint (with full_profile=true) to pull full user profiles, as described in the Hivebrite Admin API Documentation. The documentation indicates that I should receive a well‑structured JSON response with arrays for each field. However, in my Zap’s webhook trigger the data is coming in as flattened, comma‑separated strings instead of proper JSON arrays.

For example, my webhook input for several fields looks like this:

  • roleID:
    "6280,6280,6280,6285,6300,6300,6300,6300,6300,6300,6300,6300,6300,6300,6300,6300,6300,6300"

  • id:
    "7010901,7010903,7010904,7011475,7057152,7057153,7057155,7057156,7057157,7057158,7057159,7057160,7057161,7057162,7057163,7057164,7057165,7057166,7057167,7057168"

  • name:
    "Alice Johnson,Bob Smith,Charlie Brown,Diane Carter,Eve Adams,Frank Lee,Grace Miller,Hank Johnson,Ivy Thompson,Jack Robinson,Karen Green,Larry White"

  • email:
    ",,,diane@example.com,eve@example.com,frank@example.com,,hank@example.com,ivy@example.com,jack@example.com,karen@example.com,larry@example.com"

Other fields (such as headline, headshot, and linkedin) follow a similar flattened format, though they may not include the same number of leading commas.

My expectation was that the API would return these fields as proper JSON arrays—preserving the empty items from the leading commas—so that the array indexes remain aligned across fields. For example, I would expect the JSON to look like this:

json

{ "roleID": ["6280", "6280", "6280", "6285", "6300", "6300", "6300", "6300", "6300", "6300", "6300", "6300", "6300", "6300", "6300", "6300", "6300"], "id": [“7010901", "7010903", "7010904", "7011475", "7057152", "7057153", "7057155", "7057156", "7057157", "7057158", "7010903", "7010904", "7011475", "7057152", "7057153", "7057155", "7057156"], "name": ["Alice Johnson", "Bob Smith", "Charlie Brown", "Diane Carter", "Eve Adams", "Frank Lee", "Grace Miller", "Hank Johnson", "Ivy Thompson", "Jack Robinson", "Karen Green", "Larry White"], "email": ["", "", "", "diane@example.com", "eve@example.com", "frank@example.com", "grace@example.com", "hank@example.com", "ivy@example.com", "jack@example.com", "karen@example.com", "larry@example.com"] }

This structure is critical for me because I need to preserve the empty values so that when I filter records (for example, selecting only those where roleID equals "6300"), I can correctly map the corresponding id, name, email, etc.

So far, I've tried the following approaches:

  • Setting the request’s Content-Type to application/json
  • Using Zapier’s “unflatten” option
  • Employing a Code by Zapier step to split the comma‑separated strings

Unfortunately, none of these methods seem to preserve the leading empty entries; it appears that by the time the data reaches my Zap, the leading commas (and the empty items they represent) are already dropped.

The data output I’m getting is: 
{ "roleID": "6300", "id": "7057152", "name": "Eve Adams", "email": "hank@example.com" }

My question is:
Is there a setting in Zapier (or a recommended approach) to ensure that data coming in from a GET webhook is retained in its original JSON structure—including preserving empty array items (i.e. the empty values represented by leading commas)? Alternatively, if Hivebrite returns the data as flattened strings, what’s the best method to reconstruct the original arrays and account for missing values?

Any help or suggestions would be greatly appreciated!

Did this topic help you find an answer to your question?

0 replies

Be the first to reply!