SharePoint Online - Calculated field reference ends up in =#Name?

Mario 0 Reputation points
2023-05-11T16:05:14.2433333+00:00

Hi there,

I'm trying to bring a custom content model to SharePoint Online which has many fields that must be read-only, because this fields are filled through API calls from a third party system. The issue is, that I'm not able to refer from a calculated field to the value of the (hidden) original field. Here's an example:

I've defined the original field as followed in the XML (hidden="true"):

<Field Group="TPS Basis Hidden" Name="TPSSource" StaticName="TPSSource"				DisplayName="TPS Source" Title="TPSSource" Hidden="TRUE" ReadOnly="FALSE" Type="Text"		Version="1" Required="TRUE" ID="{6171696C-696e-6b73-6170-c038c36c62e2}" CustomFormatter="" Description="TPS Source from dwh system" EnforceUniqueValues="FALSE" MaxLength="255"	Indexed="TRUE"><Default></Default></Field>

After that, this is my calculated field referring to the value of the field above:

<Field Group="TPS Basis" DisplayName="TPS Source" StaticName="TPSSourceReadOnly" Name="TPSSourceReadOnly" Type="Calculated" ReadOnly="FALSE" Required="TRUE" EnforceUniqueValues="FALSE" Customization="" ResultType="Text" Version="1" Indexed="FALSE" ID="{6171696C-696e-6b73-6170-a70e486ea100}" Description="TPS Source (read-only)" >
			<Formula>=[TPS Source]</Formula>
			<FieldRefs>
				<FieldRef Name="TPSSource" ID="{6171696C-696e-6b73-6170-c038c36c62e2}"/>
			</FieldRefs>
	</Field>

I'm importing the fields with the Add-PnPFieldFromXml function.

The result is, that the referenced value of the original field does not show up in the read-only field because the formula has changed to =#NAME? (see screenshot below). This is always the case, it's always =#NAME? for all those read-only fields. To me it looks like the reference in the calculated field is wrong. But I tried it with other syntax too, without success.

<Formula>=[TPS Source]</Formula>

Tried it also with:

<Formula>[TPS Source]</Formula>
<Formula>=TPSSource</Formula>
<Formula>=(TPSSource)</Formula>

I guess it must something wrong in the definition of the original field because as this field is hidden, it does also not show up in the "Insert Column" list of the "Edit Column" setting.
I do not want to show the original field at all in the UI for the user.

User's image

How it looks like in the Library:

User's image

I appreciate any input on what I'm doing wrong here. Thanks!

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,560 questions
{count} votes