Currently im trying to add values to a custom picklist we are using inside Salesforce. Currently, after multiple days of trying, im able to create a new custom picklist like this:
url2 = "https://INSTANCE.salesforce.com/services/Soap/m/45.0/ORGID"
headers2 = {'content-type': 'text/xml; charset=utf-8', "SOAPAction":"POST"}
body2 = """<?xml version="1.0" encoding="utf-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:apex="http://soap.sforce.com/2006/08/apex"
xmlns:cmd="http://soap.sforce.com/2006/04/metadata"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<cmd:SessionHeader>
<cmd:sessionId>{0}</cmd:sessionId>
</cmd:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<create xmlns="http://soap.sforce.com/2006/04/metadata">
<metadata xsi:type="CustomField">
<fullName>Case.verursacht_durch_MA2__c</fullName>
<label>verursacht_durch_MA2</label>
<type>Picklist</type>
<valueSet>
<restricted>true</restricted>
<valueSetDefinition>
<sorted>false</sorted>
<value>
<fullName>ValueTest</fullName>
<default>false</default>
<label>ValueTest</label>
</value>
</valueSetDefinition>
</valueSet>
</metadata>
</create>
</soapenv:Body>
</soapenv:Envelope>""".format(sessionId)
response2 = requests.post(url2,data=body2,headers=headers2)
Now im trying to update values in an already existing picklist using xml. But when im trying to replace the create tag with a update tag, it tells me that tags like "fullName" "label" etc. are invalid at this location.
Any help would be much appreciated!