on 09-05-2017 9:22 AM
Hi, I want to export all employees with admingroup. Step by step process please.
Hi Ashish,
The answer from will export all employees (just a small typo in his query, the character ' (single quote) needs to be removed.
In case you wish to export all employees who belong to admingroup, then you need a couple of joins since the 'groups' is an attribute defined via a m:n relation.
INSERT_UPDATE Employee;uid[unique=true];name;
"#% impex.exportItems(""select {emp.PK} from {Employee as emp JOIN PrincipalGroupRelation as rel ON {emp.PK} = {rel.source} JOIN PrincipalGroup as pg ON {rel.target}={pg.PK}} WHERE {pg.uid}='admingroup'"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"
Hope this helps
Best
Shanmugaraja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you very much Shanmugaraja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
4 simple steps:
Go to admin console
Create your flexible query, try it out on admin console > Console > FlexibleSearch
Create export script
Run export script admin console > Console > Impex Export
Example export script:
INSERT_UPDATE Employee;uid[unique=true];name;
"#% impex.exportItems(""SELECT {pk} FROM {Employee}"", Collections.EMPTY_MAP, Collections.singletonList( Item.class ), true, true, -1, -1 );"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.