convert databags to attributes