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

List Formatting: Unable to update column containing deleted user with setValue #9670

Open
2 of 9 tasks
tecchan1107 opened this issue May 6, 2024 · 11 comments
Open
2 of 9 tasks
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@tecchan1107
Copy link
Contributor

tecchan1107 commented May 6, 2024

Target SharePoint environment

SharePoint Online

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

Declarative list formatting

Developer environment

None

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

No response

Describe the bug / error

When attempting to update a multiple selectable person column using setValue, an error is displayed if the field to be updated contains a deleted user.

image

Unable.to.update.column.containing.deleted.user.with.setValue.mp4

The update uses the appendTo and removeFrom operators. (Reference: Advanced formatting concepts)

image

*Deleted user has not been removed from the user information list.

image

Steps to reproduce

  1. Create a Favorites column (column type: Multiple Choice Person column) in the list

  2. Set the user to be deleted in the created column

    image

  3. Delete a user in the Microsoft 365 Admin Center

    image

  4. Set the following JSON in the Favorites column created

JSON
{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "children": [
    {
      "elmType": "div",
      "style": {
        "font-size": "18px",
        "padding": "2px 7px 2px 7px",
        "cursor": "pointer",
        "border-radius": "10px"
      },
      "attributes": {
        "class": "ms-bgColor-themeTertiary--hover"
      },
      "customRowAction": {
        "action": "setValue",
        "actionInput": {
          "Favorites": "=if(indexOf(@currentField.email , @me) > -1 , removeFrom(@currentField.email , @me) , appendTo(@currentField.email , @me) )"
        }
      },
      "customCardProps": {
        "openOnEvent": "hover",
        "directionalHint": "rightCenter",
        "isBeakVisible": true,
        "formatter": {
          "elmType": "div",
          "style": {
            "max-height": "300px",
            "padding": "5px 20px 5px 20px",
            "display": "flex",
            "flex-direction": "column"
          },
          "children": [
            {
              "elmType": "div",
              "txtContent": "= '💖 ' + length(@currentField)",
              "style": {
                "padding": "10px",
                "font-weight": "bold",
                "font-size": "20px"
              }
            },
            {
              "elmType": "div",
              "children": [
                {
                  "forEach": "personIterator in @currentField",
                  "elmType": "div",
                  "style": {
                    "margin-bottom": "5px",
                    "display": "flex",
                    "align-items": "center"
                  },
                  "children": [
                    {
                      "elmType": "img",
                      "style": {
                        "width": "32px",
                        "height": "32px",
                        "border-radius": "50%",
                        "margin-right": "5px"
                      },
                      "attributes": {
                        "src": "=getUserImage([$personIterator.email], 'S')",
                        "title": "[$personIterator.title]"
                      }
                    },
                    {
                      "elmType": "span",
                      "txtContent": "[$personIterator.title]"
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      "children": [
        {
          "elmType": "span",
          "style": {
            "margin-right": "5px"
          },
          "txtContent": "💖"
        },
        {
          "elmType": "span",
          "style": {
            "font-weight": "=if(indexOf(@currentField.email , @me) > -1 , 'bold' ,'' )"
          },
          "txtContent": "=length(@currentField)"
        }
      ]
    }
  ]
}

image

  1. Click the button displayed by JSON

Expected behavior

Can be updated even if deleted users are included.

@tecchan1107 tecchan1107 added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label May 6, 2024
@Fedes365
Copy link
Contributor

@tecchan1107

bug confirmed also here: #9680

@dborchers-gc
Copy link

@shagra-ms @VesaJuvonen the problems with this Bugs in setValue or missing controls got bigger and bigger. Seems like something has changed in the backend but there were no json-schema-update or soemthing else.

We are using JSON-FOrmatting in Many Very Big Lists and Sites in Our Company and have very big Pain-Points since some weeks after the SharePoint-Update "MC713894 - Upgrade for the latest Microsoft Fluent Design System visual styling on Microsoft SharePoint" and we've also created some support tickest but the support engineers often says to open issues here.

So is there any idea when this problems can be solved or any idea what's the problem here?

Sorry to annoy you with that but for us its a big problem. We love json-formating sharepoint-lists but actually its giving us full grey hair :D

@Fedes365
Copy link
Contributor

@dborchers-gc

have you tried with Microsoft Lists web app UI? Have you already run a test to check if setValue is supported? It's basically the same list URL but with "?env=WebViewList" at the end.

@dborchers-gc
Copy link

@Fedes365 doesnt work also

It is supported, it works on some lists but doesn't at the most list, since 2 or 3 weeks.

Every user who has the old ui (didn't got the MC713894 update) have no problems

@shagra-ms
Copy link
Contributor

Thanks for tagging me @dborchers-gc and bringing this to my attention. I will check with engineer on this.

@aaclage
Copy link

aaclage commented May 14, 2024

Dear @shagra-ms,

Other referenced issues affecting users :
#9614
#9617

@shagra-ms
Copy link
Contributor

Fix for this issue in currently rolling out. Please validate this again next week, and let me know if you still face problem.
@tecchan1107 @dborchers-gc

@tecchan1107
Copy link
Contributor Author

tecchan1107 commented May 14, 2024

Hi @shagra-ms ! Thanks for the fix, and the reply!

The problems I faced with List Formatting have been posted in this repository issue. The problems I am facing are as following.
https://github.com/SharePoint/sp-dev-docs/issues/created_by/tecchan1107

Other issues related to List Formatting are as following. (Search results for List Formatting)
https://github.com/SharePoint/sp-dev-docs/issues?q=is%3Aissue+is%3Aopen+List+Formatting

@shagra-ms
Copy link
Contributor

Noted @tecchan1107. We are looking into it.

@gc-LMA
Copy link

gc-LMA commented Jun 3, 2024

Hey @shagra-ms ,

also, inlineEditField doenst work in customcards anymore since the new SharePoint list update.

@VesaJuvonen VesaJuvonen added the Needs: Triage 🔍 Awaiting categorization and initial review. label Jun 19, 2024
@gc-LMA
Copy link

gc-LMA commented Jul 3, 2024

Hey @shagra-ms ,
do you have any new updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

7 participants