cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read a document's UID into a context variable?

karl_harris_
Star Collaborator
Star Collaborator

I've tried:

Value: expr:@{Document["uid:uid"]} in a Execution Context > Set Context variable (traindocuid) and get a blank(null?) when I use the traindocid variable in a User Interface > Add Info message as a check.

Message value is: traindocuid = @{traindocuid}. For the output, I get "traindocuid = " then nothing. No errors are generated on the screen or in the logs.

As a sanity check I substituted: expr:@{Document["dc:title"]} in the Set Context Variable and this works as expected.

Am I missing something?

1 ACCEPTED ANSWER

Alain_ESCAFFRE
Star Contributor
Star Contributor

Could it be related to the following bug https://jira.nuxeo.com/browse/NXS-908, fixed recently and released in the middle of next week on Studio ?

In short: Studio displays that the document HAS the uid schema while it is not the case. you could use another metadata or wait for the fix to be released.

View answer in original post

8 REPLIES 8

Alain_ESCAFFRE
Star Contributor
Star Contributor

Could it be that in the first one you set up "traindocid" variable, while you try to read "traindocuid" (pay attention to the u)

Good get! I checked, and the missing "u" is a typo in the question (I fixed the missing "u").

Alain_ESCAFFRE
Star Contributor
Star Contributor

Could it be related to the following bug https://jira.nuxeo.com/browse/NXS-908, fixed recently and released in the middle of next week on Studio ?

In short: Studio displays that the document HAS the uid schema while it is not the case. you could use another metadata or wait for the fix to be released.

All the documents I'm trying to read are extended from Folder!

Are you sure they exactly inherit from Folder ? because you had said once that you had renamed the types imported with the initial default templates. If you have renamed it, it is not the same anymore, and you will have the above mentioned bug.

any update karl?

karl_harris_
Star Collaborator
Star Collaborator

Thanks for the help !!!!

Looks like expr:Document.getId() for value in Execution Context -> Set Context Variable get's me what I needed.

I didn't realize there was more that one uid property, the "system" uid is the uid I needed.

Karl

btw, note, that the expr

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.