Hi Maze :)
this is possible with a mix of a journey, trigger and powerautomate.
First I created a trigger with two attributes, Customer Data (Contact) and Response (Text);
Then I created a journey:
Depending on the response I send the contact to different paths.
Then I choose the trigger i created previously. You can choose the same trigger for both paths, because I then map the attribute Response. For the Yes patch I add optin and for the No path I add optout. This will later be used in the PowerAutomate.
Then I create the Power Automate. There I start with "When an action is performed" where I choose the trigger. Next I look for the contact record based on the profileid of the trigger:
Then I add a condition based on the reponse attribute I added in the journey, so if optin I will create a consent record with opt in and if optout I will create a consent record with opt out.
In the "Add a new row" i create the contact point consent.
Add the mobile or business phone field from the contact in the previous step. And if you have a different purpose of topic with a different GUID also exchange this. Also Reason and Reason description can be done as you like.
And that's it :)
In my case I always create a new record for the contact point consent. This will give an error when the record for the same mobile phone number already exisits. So you might want to consider to update the existing records.
Hope this helps! :)