Knowledge Partner
Knowledge Partner
120 views

Did multiple values collected change between 3.0 and 3.5?

I was trying an ECMA for when CN or Given Name in edir is multivalued,
but IDG flags those attributes as single valued.

So my ECMA did that worked in 3.0 was:

if( inputValue[0]=='[' ) {
var jsonObj = JSON.parse(inputValue);
result=jsonObj[0];
} else {
result = inputValue;
}
outputValue=result;

Stupid, ya, if the first character is a square bracket it is JSON
multivalued, in which case, JSON.parse it then return the first value.

Otherwise return the single value.

But in 3.51 I get:
Data collection response 'STATUS' for service
eDirectoryIdentityTemplate-41-24-ebd3c341e18d47e182d7702eb19049e7:
Transformation Script Error for field 'name': [SyntaxError: Invalid
JSON: <json>:1:1 Expected json literal but found r [root] ^ in <eval> at
line number 2]

Unfortunately this is on 800 of 140,000 groups, so doing a test
collection is tricky (I guess I could change the collector to just get
the one value and do a test collection to see the data).

But does anyone know if it changed somehow, or in some major manner I
should know about?
0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

Re: Did multiple values collected change between 3.0 and 3.5?

On 5/24/19 6:44 PM, Geoffrey Carman wrote:
> I was trying an ECMA for when CN or Given Name in edir is multivalued,
> but IDG flags those attributes as single valued.
>
> So my ECMA did that worked in 3.0 was:
>
> if( inputValue[0]=='[' ) {
>                         var jsonObj = JSON.parse(inputValue);
>                         result=jsonObj[0];
>                         } else {
>                         result = inputValue;
>         }
> outputValue=result;
>
> Stupid, ya, if the first character is a square bracket it is JSON
> multivalued, in which case, JSON.parse it then return the first value.
>
> Otherwise return the single value.
>
> But in 3.51 I get:
> Data collection response 'STATUS' for service
> eDirectoryIdentityTemplate-41-24-ebd3c341e18d47e182d7702eb19049e7:
> Transformation Script Error for field 'name': [SyntaxError: Invalid
> JSON: <json>:1:1 Expected json literal but found r [root] ^ in <eval> at
> line number 2]
>
> Unfortunately this is on 800 of 140,000 groups, so doing a test
> collection is tricky (I guess I could change the collector to just get
> the one value and do a test collection to see the data).
>
> But does anyone know if it changed somehow, or in some major manner I
> should know about?

Greetings,
There was not a change between 3.0.x and 3.5.x in this regard. The
issue is happening because of your data. You can see the issue with the
stand test tool as well.

--
Sincerely,
Steven Williams
Principal Enterprise Architect
Micro Focus
0 Likes
Knowledge Partner
Knowledge Partner

Re: Did multiple values collected change between 3.0 and 3.5?

>     There was not a change between 3.0.x and 3.5.x in this regard.  The
> issue is happening because of your data.  You can see the issue with the
> stand test tool as well.


So what Steve figured out was that I had groups, whose CN started as
[root].something and since my way of testing for a JSON Array was
looking for an [ (open square bracket) and assuming it was a JSON array
at that point.

So I tried JSON Parse on that string, and the error is that [root] is
not a JSON array just not as clearly stated as I would like.

Good catch Steve, thanks for the help, I appreciate it.

I used the /opt/netiq/idm/apps/idgov/transformtester.sh to make sure my
ECMA was working.

But I did not know the specific entry that was causing the error, so I
could not find it to run through. I suppose I could have edited the Test
Collection data file to make it just the values and see if it errors on
one of them. Never tried it that way.



0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.