Hi @Jasper Bakker ,
Great to know that and thanks for sharing the update here.
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:
[Change column name using REST API - Logic App]
Issue Symptom:
Good day to you all. First time posting a request. Hope it get’s received well.
I seem to have a problem and not sure what I might be doing wrong. Maybe it's a bug. I don't know.
I am trying to provision a SharePoint communication site programmatically using SharePoint REST api (_api/SPSiteManager/create). Hence no problems here. Site gets created without any problems using a predefined body.
In my workflow I also provision multiple columns (at the site level) using SchemaXML (_api/Web/Fields/createfieldasxml). The internal name and display name differ. No problems here. It is possible to share the XML, but I do not think this is the problem.
After creating the SharePoint columns at the site level I want to add them to the default SharePoint SitePages library using the same SchemaXml (_api/Web/Lists(guid'{GUID of SitePages lib.}')/Fields/createfieldasxml). Hench the problem (I think).
It appears that when provisioning the site programmatically (_api/SPSiteManager/create), a not so unique GUID, is being used for the SitePages library. I found the following article explaining this problem: https://www.wictorwilen.se/blog/when-a-guid-is-not-really-unique-i-m-looking-at-you-sharepoint/
When patching the field column Title/Display name of the columns using the not so unique id of the SitePages library and a predifined Id of the column (hence the use of SchemaXML), I am unable to update the field name. It simple does not reflect correctly in SharePoint.
I have tried multiple ways to update the Title field (using Graph, REST, not use SchemaXML, maybe caching issue in browser). They all simple do not change the display name. I have also tried provisioning the site using powershell using New-PnPSite. This also creates a site with the same SitePages GUID. I have not testing changing the display name afterwords, but I prefer not to use PowerShell to keep the workflow as simple and straight forward as possible (use of one technology).
Manualy changing the display name in SharePoint does work (how strange). Changing the display name of SitePages columns using mentioned Graph/REST calls in different sites (forinstance a group) does work.
I simply do not understand what I am doing wrong or what I might need to do to get this to work. Maybe manually provision the SitePages library. I am not getting any more ideas at this moment.
Current status:
When testing no problems persisted (because I was testing in Firefox). After which I thought, can it be a caching problem, which it was. I was testing in Edge (even incognito), same result. When opening the site in Firefox the title’s were correctly displaying.
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community members to see the useful information when reading this thread. Thanks for your understanding!