BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
infmja
Obsidian | Level 7

Hey there

 

I added a user to the SAS metadata using the XML Metadata Interface. In the "Add Metadata" tab, I used the following XML:

 

<Person Desc="" DisplayName="Testuser" IsHidden="0" Name="Testuser Test" Title="Tester"/>

 

This worked absolutely fine. Now I need to add the user to a group which is already existing in the metadata.

I tried the following in the "Update Metadata" tab:

 

<Person Id="A5NUQPXO.AP00002V">
            <IdentityGroups>
                <IdentityGroup Id="A5NUQPXO.A500001C" Name="REU" Desc="REU Reporting"/>
            </IdentityGroups>
</Person>

 

This didn't work and it responded with the following error:

Error:
com.sas.iom.SASIOMDefs.GenericError: The association from IdentityGroup : A5NUQPXO.A500001C to Person : A5NUQPXO.AP00002V cannot be created.
The association from IdentityGroup : A5NUQPXO.A500001C to Person : A5NUQPXO.AP00002V cannot be created.

 

 

The IDs should actually be correct. I used the Metadata browser in the SAS Foundation and copied the IDs from there.

 

Do you know how I can add a user to a group using the XML Metadata Interface?

 

 

Kind regards

Martin

1 ACCEPTED SOLUTION

Accepted Solutions
boemskats
Lapis Lazuli | Level 10

Hi Martin,

 

Try this instead, it should work.

 

<Person Id="A5NUQPXO.AP00002V">
  <IdentityGroups>
    <IdentityGroup ObjRef="A5NUQPXO.A500001C" />
  </IdentityGroups>
</Person>

 

Nik

View solution in original post

3 REPLIES 3
boemskats
Lapis Lazuli | Level 10

Hi Martin,

 

Try this instead, it should work.

 

<Person Id="A5NUQPXO.AP00002V">
  <IdentityGroups>
    <IdentityGroup ObjRef="A5NUQPXO.A500001C" />
  </IdentityGroups>
</Person>

 

Nik

infmja
Obsidian | Level 7

Thank you very much Nik! It worked!

Is there a documentation about these XMLs somewhere or how/where did you figure it out?

boemskats
Lapis Lazuli | Level 10

It's in the SAS docs here: http://documentation.sas.com/?docsetId=omaref&docsetTarget=n1ow0lbqw8ktpwn1e37i0p90jeaz.htm&docsetVe...

 

Most of the OMI documentation is awesome, there's just a lot of it. Quoting from the page I linked to:

The AddMetadata method creates a new object for every property string that is submitted in the <METADATA> element, unless the ObjRef attribute is included in the property string. ObjRef is supported only in a nested property string. It specifies that the object instance is an existing metadata object. It instructs the SAS Metadata Server to create an object reference to the specified object without modifying the specified object's other properties. 
 
Not sure how much this applies as you're updating metadata rather than adding. I dug it up from some old code, so I'm pretty sure my 'journey of discovery' was trial & error 🙂
 
 
 
 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2960 views
  • 4 likes
  • 2 in conversation