we are trying to import users into a specific group but cant figure out how the json should go. Currently we have:
[
{
"@model": "User",
"attributes": {
"username": "name@example.com",
"firstName": "john",
"lastName": "smith",
"email": "name@example.com",
"pending": "0",
"lastLoginDate": "2017-08-11 04:12:06",
"dateCreated": "2017-11-06 12:04:04",
"dateUpdated": "2017-11-06 12:04:04"
},
"content": {
"fields": {
"customField": "00000"
}
},
"settings": {
"groups": {
"groupId": "1"
}
}
}
]
We've tried several variations on settings, permissions, and putting groups under content and attributes but nothing has worked so far.
populateModelFromPost()
(or something like that) line to the normalpopulateModel
and used my own array that has exactly the same structure like the form in your cp - you just need to inspect the html. It took me about 10 minutes to create that import. To be honest I don't think sprout did something much more complicated. You could insert avar_dump
into crafts userController and try to create the same structure in your array for sprout – Robin Schambach Nov 8 '17 at 20:01