0

I customized a list form via JSON to sort the entries for the user. Now I want to modify a text in the header based on if there's an attachment in that list item or not.

I already included the attachment-column in my list. My code (not working) so far is:

"txtContent": "=if([$Attachments] == 0, 'no attachment', 'item has attachment')"

I also tried to put the number in '', changed it to true and false. Nothing works.

1
  • Are you trying to add this JSON in list view or list form? Commented Mar 23, 2022 at 10:07

1 Answer 1

1

This is a known behavior of JSON list formatting in SharePoint. Unfortunately, the "Attachments" field is not directly accessible in JSON list formatting.

Similar thread: Clickable href with the attachments

Documentation: Use column formatting to customize SharePoint


Update:

Attachments column is now supported in JSON formatting. Check documentation: Supported column types

You can use the expression like this:

"txtContent": "=if([$Attachments] == '0', 'no attachment', 'item has attachment')"
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.