Fix: Power Apps JSON Cannot Serialize Attachments Error (Table(Attachment)) — 2 Solutions

If you’ve been building a Power Apps canvas app connected to a SharePoint list or Dataverse table and hit this error:

“The JSON function cannot serialize tables / objects with a nested property called ‘{Attachments}’ of type ‘Table(Attachment)'”

You’re in the right place. I’ve run into this exact error myself while trying to extract column names from a SharePoint list using the JSON() function. The fix is simple, but the why behind it is worth understanding so you don’t get surprised again.

Let me walk you through the root cause, the fix, and a few real-world scenarios where this pops up.

What Causes This Error?

The JSON() function in Power Apps converts a data structure — a collection, record, or table — into a JSON text string. It’s useful for tasks such as sending data to Power Automate, extracting column names, or logging app state.

Here’s the basic syntax:

JSON(DataStructure [, Format])

The Format parameter controls how the function handles different data types. By default (JSONFormat.Compact), it blocks binary data and unsupported column types — and throws an error if it runs into either.

Now, here’s the thing about SharePoint lists: every SharePoint list has an Attachments column built in, even if you never use it. This column is stored as a Table(Attachment) type — a nested table inside your list record. That’s not a binary value (like an image or video), so JSONFormat.IgnoreBinaryData alone doesn’t catch it. The JSON() function hits that nested table, doesn’t know what to do with it, and throws the error.

In short: IgnoreBinaryData handles media files. IgnoreUnsupportedTypes handles everything else that JSON can’t serialize — including nested table columns like Attachments.

The Fix: Power Apps JSON Cannot Serialize Attachments Error (Table(Attachment))

Combine JSONFormat Flags with the & Operator

The solution is to add JSONFormat.IgnoreUnsupportedTypes to your formula. You can combine multiple JSONFormat flags using the & operator.

Here’s the corrected formula:

JSON(YourCollection, JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes)

That’s it. The IgnoreUnsupportedTypes flag tells Power Apps: “If you hit a data type you can’t serialize, just skip it — don’t throw an error.”

⚠️ Important warning: IgnoreUnsupportedTypes silently drops those unsupported fields from your output. So if your downstream logic (a Power Automate flow, for example) is expecting an Attachments field in the JSON, it won’t be there. You won’t get an error — you’ll just get missing data. Always check your JSON output after applying this fix.

Scenario 1: Extracting Column Names from a SharePoint List

This is the scenario I hit personally. I had an Employee Onboarding SharePoint list with columns like Employee Name, Employee Last Name, Employee ID, and so on. I wanted to dynamically grab all column names in Power Apps.

Step 1: Create a Power Apps Collection from your SharePoint list on a button’s OnSelect property:

ClearCollect(
colEmpOnboardingDetails,
'Employee Onboarding'
);

Where:

  • colEmpOnboardingDetails = your collection name
  • 'Employee Onboarding' = your SharePoint list name

Step 2: Use the JSON() function to extract column names:

Set(
varListColumnNames,
Distinct(
Ungroup(
MatchAll(
JSON(colEmpOnboardingDetails, JSONFormat.IgnoreBinaryData),
"([""][^""]+[""])\s*:"
).SubMatches,
"SubMatches"
),
Value
)
)
Extracting Column Names from a SharePoint List
The JSON function cannot serialize tables / objects with a nested property called '{Attachments}' of type 'Table (Attachment)'.

This is where the error hits, because the JSON() function encounters the Attachments column of type Table(Attachment).

Step 3: Apply the fix by adding JSONFormat.IgnoreUnsupportedTypes:

Set(
varListColumnNames,
Distinct(
Ungroup(
MatchAll(
JSON(colEmpOnboardingDetails, JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes),
"([""][^""]+[""])\s*:"
).SubMatches,
"SubMatches"
),
Value
)
)
Power Apps JSON Cannot Serialize Attachments Error

Save, publish, and test your app — the error is gone, and you get your column names back cleanly.

Scenario 2: Sending a SharePoint Collection to Power Automate as JSON

Another very common place this error shows up is when you’re passing a collection to a Power Automate flow. You might have something like this on a Power Apps button:

PowerAutomateFlow.Run(
JSON(colMySharePointData, JSONFormat.IgnoreBinaryData)
)

Here, inplace of colMySharePointData, provide your collection name that contains SharePoint list data.

If the SharePoint list behind that collection has Attachments enabled (which almost all do by default), you’ll get the same serialization error.

The JSON function cannot serialize tables / objects with a nested property called '{Attachments}' of type 'Table (Attachment)'.
Sending a SharePoint Collection to Power Automate as JSON Error

The fix is identical — just add the second flag:

ClearCollect(
colLeaveRequests,'Employee Leave Requests'
);

LeaveRequestsPARSING.Run(JSON(colLeaveRequests,JSONFormat.IncludeBinaryData& JSONFormat.IgnoreUnsupportedTypes))
fix power apps serialization Json error

One thing to keep in mind here: if you’re sending this JSON to a flow that parses the payload with a Parse JSON action, regenerate the schema after applying the fix. The Attachments field will no longer appear in your output, which can break schema validation downstream.

Scenario 3: Dataverse Tables with Polymorphic or Complex Columns

This error doesn’t just happen with SharePoint. If you’re working with a Dataverse table that contains polymorphic lookup columns (like an Owner field, which can point to either a User or a Team), you’ll see a similar error:

Dataverse Tables with Polymorphic or Complex Columns

“The JSON function cannot serialize tables / objects with a nested property called ‘_ownerid_value’ of type ‘Polymorphic'”

The fix is the same approach. When you call JSON() on a Dataverse collection, use:

JSON(colMyDataverseCollection, JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes)
dataverse tables with polymorphic or complex columns issue fix

Dataverse tables tend to have more of these unsupported column types — Owner, Regarding (polymorphic lookups), Activity Party columns — so this combination of flags is practically standard when working with Dataverse collections.

All JSONFormat Flags and What They Do

Since you’re already using the Format parameter, here’s a quick reference for all available JSONFormat enum values you can combine:

FlagWhat It Does
JSONFormat.CompactDefault. No extra spaces or newlines. Blocks binary data and unsupported types.
JSONFormat.IndentFourAdds newlines and 4-space indentation. Easier to read for debugging.
JSONFormat.IncludeBinaryDataIncludes image, video, and audio columns in the output.
JSONFormat.IgnoreBinaryDataSkips image, video, and audio columns without erroring.
JSONFormat.IgnoreUnsupportedTypesSkips unsupported data types (like nested tables) without erroring.
JSONFormat.FlattenValueTablesFlattens Power Fx Value tables into standard JSON arrays.

You can combine any of these with &. For example, if you also want a readable output while debugging:

JSON(colMyCollection, JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes & JSONFormat.IndentFour)

When Should You NOT Use IgnoreUnsupportedTypes?

This flag is great for scenarios where you only care about the supported fields — like extracting column names, logging, or passing simple data to a flow.

But avoid it if:

  • Your flow or API needs the Attachments data. The flag silently drops those fields — you won’t get an error, but the data will be missing.
  • You’re generating a JSON payload for a strict schema. Missing fields can break schema validation in Power Automate’s Parse JSON action or an external API.
  • You’re trying to back up or migrate record data. Silent data loss in that context is a real problem.

In those cases, you’ll need a different approach — like handling attachments separately using EncodeUrl() or passing attachment metadata through a dedicated flow action instead of serializing it with JSON().

Quick Summary of the Fix

If you’re in a hurry, here’s everything in three lines:

  • Root cause: SharePoint’s built-in Attachments column is stored as Table(Attachment) — a nested table type that JSON() can’t serialize by default
  • Why IgnoreBinaryData alone doesn’t work: That flag only handles media files (images, videos, audio), not nested table columns
  • The fix: Add JSONFormat.IgnoreUnsupportedTypes using the & operator → JSON(yourCollection, JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes)

Also, you may like:

Frequently Asked Questions

Does this fix work for all SharePoint lists, not just ones where I’ve uploaded attachments?

Yes. The error appears because the Attachments column exists on the list schema — not because there are actual attachment files in the records. Even an empty SharePoint list will have this column in its schema.

Will IgnoreUnsupportedTypes remove other data from my JSON output besides Attachments?

Possibly. Any column that Power Fx can’t serialize to JSON will be silently dropped. This typically includes:
Attachment columns (Table(Attachment))
Polymorphic lookup columns (Owner, Regarding)
Certain Dataverse activity columns
Always inspect the resulting JSON string to confirm which fields made it through.

I applied the fix but my JSON output is now empty. What’s wrong?

This is a different issue — usually caused by trying to serialize a collection that itself was built from a SharePoint search result or an UntypedObject source. In that case, you may need to build the JSON manually using string concatenation or a ForAll() loop instead of relying on the JSON() function directly.

Can I use JSONFormat.IgnoreUnsupportedTypes without JSONFormat.IgnoreBinaryData?

Yes, they’re independent flags. If your list or table has no image/video columns, you can use IgnoreUnsupportedTypes on its own. That said, it’s a good habit to include both when working with SharePoint lists since most real-world lists tend to have media-related columns or attachments.

Does this error appear in model-driven apps too?

The JSON() function is primarily a canvas app function. Model-driven apps handle data differently and don’t expose this function in the same way. If you’re hitting serialization issues in a model-driven context, the root cause will be different — typically a Dataverse Web API error rather than a Power Fx serialization error.

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App