Updating a list in SharePoint framework - SPFx WebPart

%3CLINGO-SUB%20id%3D%22lingo-sub-2655545%22%20slang%3D%22en-US%22%3EUpdating%20a%20list%20in%20SharePoint%20framework%20-%20SPFx%20WebPart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2655545%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20followed%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fweb-parts%2Fget-started%2Fprovision-sp-assets-from-package%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ethis%20tutorial%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Ftoolchain%2Fprovision-sharepoint-assets%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ethis%20documentation%3C%2FA%3E%26nbsp%3Bin%20order%20to%20create%20lists%20and%20columns%20within%20SharePoint%20Online.%20Everything%20seems%20to%20work%20fine%20when%20creating%20them%20for%20the%20first%20time.%20But%20when%20I%20try%20to%20modify%20an%20existing%20column%20within%20an%20existing%20list%20using%26nbsp%3B%3CEM%3Eelements-v2.xml%3C%2FEM%3E%2C%20after%20redeploying%20the%20app%20in%20my%20app%20catalogue%20then%20updating%20the%20existing%20app%2C%20the%20modified%20columns%20haven't%20been%20updated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20only%20thing%20that%20works%20successfully%20after%20updating%20my%26nbsp%3B%3CEM%3Eelements-v2.xml%26nbsp%3B%3C%2FEM%3Eis%20creating%20new%20lists%20or%20adding%20columns%20to%20existing%20lists.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%26nbsp%3B%3CEM%3Eelements.xml%2C%3C%2FEM%3E%26nbsp%3B%3CEM%3Eschema.xml%26nbsp%3B%3C%2FEM%3Eand%20%3CEM%3Epackage-solution.json%26nbsp%3B%3C%2FEM%3Eare%20the%20same%20as%20in%20the%20tutorial%20in%20the%20first%20link.%3C%2FP%3E%3CP%3EWithin%26nbsp%3B%3CEM%3Eelements-v2.xml%3C%2FEM%3E%20I%20have%3A%3C%2FP%3E%3CP%3E(I%20want%20to%20add%20an%20additional%20choice%20on%20line%2024)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%0A%3CELEMENTS%20xmlns%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fsharepoint%2F%22%3E%0A%20%20%3CLISTINSTANCE%20featureid%3D%2200bfea71-de22-43b2-a848-c05709900100%22%20title%3D%22New%20List%22%20description%3D%22New%20list%20provisioned%20from%20v2%22%20templatetype%3D%22100%22%20url%3D%22Lists%2FNewList%22%3E%0A%20%20%3C%2FLISTINSTANCE%3E%0A%0A%3CFIELD%20id%3D%22%7B943E7530-5E2B-4C02-8259-CCD93A9ECB18%7D%22%20name%3D%22SPFxCostCenter%22%20displayname%3D%22Cost%20Center%22%20type%3D%22Choice%22%20required%3D%22FALSE%22%20group%3D%22SPFx%20Columns%22%3E%0A%20%20%20%20%20%20%20%20%3CCHOICES%3E%0A%20%20%20%20%20%20%20%20%3CCHOICE%3EAdministration%3C%2FCHOICE%3E%0A%20%20%20%20%20%20%20%20%3CCHOICE%3EInformation%3C%2FCHOICE%3E%0A%20%20%20%20%20%20%20%20%3CCHOICE%3EFacilities%3C%2FCHOICE%3E%0A%20%20%20%20%20%20%20%20%3CCHOICE%3EOperations%3C%2FCHOICE%3E%0A%20%20%20%20%20%20%20%20%3CCHOICE%3ESales%3C%2FCHOICE%3E%0A%20%20%20%20%20%20%20%20%3CCHOICE%3EMarketing%3C%2FCHOICE%3E%0A%20%20%20%20%20%20%20%20%3CCHOICE%3ENew%20Choice%3C%2FCHOICE%3E%0A%20%20%20%20%20%20%20%20%3C%2FCHOICES%3E%0A%20%20%20%20%3C%2FFIELD%3E%0A%0A%3C%2FELEMENTS%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWithin%20my%26nbsp%3B%3CEM%3Eupgrade-actions-v2.xml%26nbsp%3B%3C%2FEM%3E%20I%20have%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3CAPPLYELEMENTMANIFESTS%3E%0A%20%20%3CELEMENTMANIFEST%20location%3D%224d9c0146-1219-986c-8d4e-984b42efd732%5Celements-v2.xml%22%3E%3C%2FELEMENTMANIFEST%3E%0A%3C%2FAPPLYELEMENTMANIFESTS%3E%0A%0A%3CADDCONTENTTYPEFIELD%20contenttypeid%3D%220x010042D0C1C200A14B6887742B6344675C8B%22%20fieldid%3D%22%7B943E7530-5E2B-4C02-8259-CCD93A9ECB18%7D%22%20pushdown%3D%22TRUE%22%3E%3C%2FADDCONTENTTYPEFIELD%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EDoes%20anyone%20have%20any%20suggestions%20on%20how%20I%20can%20modify%20an%20existing%20column%20using%20spfx%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2655545%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Framework%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I have followed this tutorial and this documentation in order to create lists and columns within SharePoint Online. Everything seems to work fine when creating them for the first time. But when I try to modify an existing column within an existing list using elements-v2.xml, after redeploying the app in my app catalogue then updating the existing app, the modified columns haven't been updated.

 

The only thing that works successfully after updating my elements-v2.xml is creating new lists or adding columns to existing lists.

 

My elements.xml, schema.xml and package-solution.json are the same as in the tutorial in the first link.

Within elements-v2.xml I have:

(I want to add an additional choice on line 24)

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance
    FeatureId="00bfea71-de22-43b2-a848-c05709900100"
    Title="New List"
    Description="New list provisioned from v2"
    TemplateType="100"
    Url="Lists/NewList">
  </ListInstance>

<Field ID="{943E7530-5E2B-4C02-8259-CCD93A9ECB18}"
            Name="SPFxCostCenter"
            DisplayName="Cost Center"
            Type="Choice"
            Required="FALSE"
            Group="SPFx Columns">
        <CHOICES>
        <CHOICE>Administration</CHOICE>
        <CHOICE>Information</CHOICE>
        <CHOICE>Facilities</CHOICE>
        <CHOICE>Operations</CHOICE>
        <CHOICE>Sales</CHOICE>
        <CHOICE>Marketing</CHOICE>
        <CHOICE>New Choice</CHOICE>
        </CHOICES>
    </Field>

</Elements>

 

 

 

 

Within my upgrade-actions-v2.xml  I have:

 

 

 

 

<ApplyElementManifests>
  <ElementManifest Location="4d9c0146-1219-986c-8d4e-984b42efd732\elements-v2.xml" />
</ApplyElementManifests>

<AddContentTypeField 
     ContentTypeId="0x010042D0C1C200A14B6887742B6344675C8B" 
     FieldId="{943E7530-5E2B-4C02-8259-CCD93A9ECB18}" 
     PushDown="TRUE" />

 


Does anyone have any suggestions on how I can modify an existing column using spfx?

0 Replies