Nextcloud does not pull the users group from Azure AD

We have Nextcloud with Azure AD using the official SAML app. Users are able to login using Azure AD login. However, I can’t seem to get the groups to work.

User A is part of Sales and Operations group in Azure AD. However, if I create a group called Sales and another group called Operations, it doesn’t get added to the user.

How can I configure Nextcloud to pull the group info from the user?

If I manually assign the group created in Nextcloud, it loses this info when the user signs out.