Added function to check if a community is a sub community and , changed

the createData function to call this function. If the community is a sub
community a link to the parent community is added to the payload so the
parent child relationship is not broken on community updates.