Added ability to pass arrays for attributes

Useful feature so thought I'd add it and do a pull request

Adds feature request in #2978