Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$FSObjType returns a string in SharePoint Custom Column Formatting #10097

Open
1 of 9 tasks
deepwaterpaladin opened this issue Jan 29, 2025 · 0 comments
Open
1 of 9 tasks

Comments

@deepwaterpaladin
Copy link

What type of issue is this?

Question

What SharePoint development model, framework, SDK or API is this about?

Site designs & site scripts

Target SharePoint environment

SharePoint Online

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • chrome version: Version 132.0.6834.83 (Official Build) (32-bit)

Issue description

Why does Sharepoint's Custom Column Formatting treat $FSObjType as a string, rather than an integer? Would it not make more sense for $FSObjType to be an integer?

// Incorrect usage
"display": {
                    "operator": "?",
                    "operands": [
                        {
                            "operator": "&&",
                            "operands": [
                                {
                                    "operator": "!=",
                                    "operands": [
                                        "[$FSObjType]",
                                        0
                                    ]
                                },
                                {
                                    "operator": "!=",
                                    "operands": [
                                        {
                                            "operator": "startsWith",
                                            "operands": [
                                                "[$ContentTypeId]",
                                                "0x0120D520"
                                            ]
                                        },
                                        true
                                    ]
                                }
                            ]
                        },
                        "flex",
                        "none"
                    ]
                }

// Correct usage
"display": {
                    "operator": "?",
                    "operands": [
                        {
                            "operator": "&&",
                            "operands": [
                                {
                                    "operator": "!=",
                                    "operands": [
                                        "[$FSObjType]",
                                        "0"
                                    ]
                                },
                                {
                                    "operator": "!=",
                                    "operands": [
                                        {
                                            "operator": "startsWith",
                                            "operands": [
                                                "[$ContentTypeId]",
                                                "0x0120D520"
                                            ]
                                        },
                                        true
                                    ]
                                }
                            ]
                        },
                        "flex",
                        "none"
                    ]
                }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant