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

Dynamic Form - Column 'MediaServiceImageTags_0' does not exist #1451

Open
hdmal opened this issue Feb 8, 2023 · 11 comments
Open

Dynamic Form - Column 'MediaServiceImageTags_0' does not exist #1451

hdmal opened this issue Feb 8, 2023 · 11 comments
Labels

Comments

@hdmal
Copy link

hdmal commented Feb 8, 2023

Category

Bug

Version

Please specify what version of the library you are using: 3.12.0

  • SPFx : 1.16.1
  • React: 17.0.1

Expected / Desired Behavior / Question

Control should be rendered in all the document libraries and lists with all the available item properties.

Observed Behavior

Dynamic Form has been used in a SharePoint Online ListView Extension project. Item properties are loading fine in all the Lists and Document Libraries, except in one Document Library.

Following is the code segment:

public render(): JSX.Element {
return (


<DynamicForm
// eslint-disable-next-line @typescript-eslint/no-explicit-any
context={this.props.clientContext as any}
listId={sessionStorage.getItem('listID')}
listItemId={this.props.itemID}
onCancelled={this._onCancelled}
onBeforeSubmit={async (listItem) => { return false; } }
onSubmitError={(listItem, error) => { alert(error.message); } }
onSubmitted={async (listItemData) => { this._onSubmitted() } }
/>

);
}

Steps to Reproduce

For this particular Document Library, file properties are not getting loaded and hangs on with the message "Loading.. Please wait.."

When I did a network inspection, I got the below error.

image

I have not created or deleted a custom column called "MediaServiceImageTags_0" in the Document Library. Even though I had, shouldn't the Dynamic Form capture the changes and render the available columns?

I am attaching a screenshot with the error message below.

image

Can you please help on this?

Thanks!

@ghost
Copy link

ghost commented Feb 8, 2023

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@ghost ghost added the Needs: Triage 🔍 label Feb 8, 2023
@github-actions
Copy link

github-actions bot commented Feb 8, 2023

Thank you for submitting your first issue to this project.

@joelfmrodrigues
Copy link
Collaborator

Possible duplicate of #1422
@hdmal does this list have a managed metadata field? If so, would you be able to test with the latest beta release?

@hdmal
Copy link
Author

hdmal commented Mar 2, 2023

Possible duplicate of #1422 @hdmal does this list have a managed metadata field? If so, would you be able to test with the latest beta release?

Thanks for checking Joel. No managed metadata fields. Just standard and Lookup fields. Attaching a screenshot of the columns.

image

@joelfmrodrigues
Copy link
Collaborator

@hdmal just realized that this column is actually a standard hidden column from SharePoint.
Please try installing the beta version of the controls as I think this is a duplicate of the issue linked above (seems to be the same error message). The beta version contains a fix for it.

@hdmal
Copy link
Author

hdmal commented Mar 2, 2023

@hdmal just realized that this column is actually a standard hidden column from SharePoint. Please try installing the beta version of the controls as I think this is a duplicate of the issue linked above (seems to be the same error message). The beta version contains a fix for it.

Thanks Joel.

Tried the beta version (3.14.0-beta.4302330) and the form loaded successfully this time. However, there are couple of issues in the form.

image

  1. Lookup field value is blank
    "Project Code" is a Lookup field and the form won't display the value properly.

image

However, if I close/clear the selected "Project Code" value in the form, and click on the "Project Code" text field, it displays all
the available "Project Codes" in a dropdown nicely. And, I can select and save one with no issues. When I check the SharePoint
list later, even the column gets updated properly.

  1. "Image Tags" column
    I did not create a column called "Image Tags" in my Doc Library. Do you know why did it appear in the form?

Thank you.

@joelfmrodrigues
Copy link
Collaborator

Hi @hdmal, sorry for the late reply

  1. This seems like a different bug. Could you please provide details about the Project Code field from the Project Master list?
  2. I believe this is a hidden column from Microsoft that is there to support some native functionality. If this is the case, then the form should not be displaying it. Is it displayed on the SharePoint list item edit form?
    Anyway, the control has a property to hide fields, which is missing from the documentation (I just updated it) and you should be able to use that property to hide that field
  /**
   * InternalName of fields that should be hidden
   */
  hiddenFields?: string[];

@hdmal
Copy link
Author

hdmal commented Mar 8, 2023

Hi @joelfmrodrigues , Thanks for you response. Please see my response below for each point.

  1. You are right. There is another bug with the Lookup columns. Following is my lookup master.
    image

I think I found the issue.

  • In the Document Library, use "Project Code" field in the Master to get the Lookup information : This will fail with a blank value
    image

Output:

image

  • In the Document Library, use "Title" field in the Master to get the Lookup information : This will work
    image

Output:

image

Seems Lookup column works only if we use "Title" field to get information from Master list. In the Lookup Master List, I had to duplicate the "Project Code" field values in "Title" field to get this working.

  1. Yes, it's displayed in the edit form. Looks like that Microsoft introduced AI generated tags to improve search. Didn't notice until now. Expecting lot of complaints from the clients. :)
    image

"hiddenFields" property did help to hide the autogenerated field. Thanks.

Can you please look into Point 1?

@joelfmrodrigues
Copy link
Collaborator

@hdmal many thanks for the very detailed response, it's much easier to follow up this way :)
I had a quick look at the code and found the location where the field value is retrieved. It looks like the code is trying to get the value of the lookup field configured, and if the configured field is not valid, it defaults to Title. So, something must be failing along the way and needs to be debugged
Any chance you could try to debug it? Should be an easy fix once we identify the issue.
I have work planned for the next 2 nights (at least) so may be able to look into in by end of the week best case scenario

} else if (fieldType === "Lookup") {

@hdmal
Copy link
Author

hdmal commented Mar 17, 2023

@hdmal many thanks for the very detailed response, it's much easier to follow up this way :) I had a quick look at the code and found the location where the field value is retrieved. It looks like the code is trying to get the value of the lookup field configured, and if the configured field is not valid, it defaults to Title. So, something must be failing along the way and needs to be debugged Any chance you could try to debug it? Should be an easy fix once we identify the issue. I have work planned for the next 2 nights (at least) so may be able to look into in by end of the week best case scenario

} else if (fieldType === "Lookup") {

@joelfmrodrigues apologies for taking long to reply.

REST call to gets the field information properly by expanding the Lookup field.
image

Issue occurs when it tries to set the Lookup field's text value in the form.

Issue is when it tries to set the form field value.

@joelfmrodrigues
Copy link
Collaborator

@hdmal really sorry for the delay on this, I've been really busy and unable to look into this
Your info is a great help to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants