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

SPO changes format of custom ID #76

Open
phhoef opened this issue Mar 24, 2024 · 2 comments
Open

SPO changes format of custom ID #76

phhoef opened this issue Mar 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@phhoef
Copy link

phhoef commented Mar 24, 2024

I am storing a few meta data through the item.Update function.
One information is a custom id, that typically looks similar to this CF7F5BC8B5031EEEB6D978E8BD860E6A

I've introduced a custom type with additional fields to hold all of my information.
The type of this field is text.
In the web interface of SPO, the ID is shown exactly as the one above.
But when I access the item through the API and get the same id with a different format cf7f5bc8-b503-1eee-b6d9-78e8bd860e6a. It now looks like a uuid ...
Though, the field has the suffix OWSTEXT.

I am not sure if this is directly related to this library.
Is there something wrong with my update function?

Versions
SharePoint Online

@phhoef phhoef added the bug Something isn't working label Mar 24, 2024
@koltyakov
Copy link
Owner

Hi @phhoef,

That doesn't sound as a bug. The library fetches different SharePoint APIs and returns payloads with little or no transformations (only normalizations for OData verbosity).

Can you provide an exact sample for what you doing? Comparing response with what is returned from the API, e.g. using Postman could help to see if the data is returned the way you're getting it via the library.

@phhoef
Copy link
Author

phhoef commented Mar 25, 2024

Hallo @koltyakov,

thanks for your fast reply 😄
You're right, it's probably not related to your lib.

I've a function that updates the properties.

func update(item *api.Item, props map[string]any) error {
	content, err := json.Marshal(props)
	if err != nil {
		return err
	}

	_, err = item.Update(content)
	return err
}

I accessed the property with the SharePoint Search Query tool, and the result is the same.
If it's not going wrong during updating the properties, it's not related the lib.

Though, can you imagine why this is happening?
It's driving me nuts. It's an id and SPO is changing the internal representation for some reason.
The weird thing is, that it is displayed properly in the web interface. It's just how it is internally stored.
My big problem is, that I do want to search for this ID, and it's super annoying, that it cannot be found by the original string.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants