web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Automatically create a consent record for new contacts

(1) ShareShare
ReportReport
Posted on by 37
I have set up a cloud flow to create an opt-in consent record for new contacts that are added.
But it is just not working - the test shows that it's run successfully, but it's not adding an opt-in consent record. 
I think the issue must be coming from the 'Condition' step - because I added a new contact, which means it should have gone down the 'true' path and added a new consent record. But, it's gone down false, and the contact's consent is still not set. 
 
Has anyone tried to set this up and had the same problem?
Thanks.
I have the same question (0)
  • Suggested answer
    Tom_Gioielli Profile Picture
    2,891 Super User 2025 Season 2 on at
    The 'Empty' function can act a little weird outside of Canvas Apps in my experience. I usually avoid it myself in flows.
     
    Try it with the length function I indicated above and see if it works. My guess is that Empty is not checking for records returned, but if anything came back in the List Rows action (which Power Automate always returns at least something, even if it isn't records).
     
     
    If this response helped, please consider marking as verified so future users can see the resolution. If you have additional questions or problems, please tag me in the response so I receive a notification.
  • BS-18090839-0 Profile Picture
    37 on at
    Thank you for taking the time to reply. A screenshot of the condition is here. 
    is equal to true.
     
    And yes, that's correct - using the list rows to validate that there are no existing consent records.
  • Suggested answer
    Tom_Gioielli Profile Picture
    2,891 Super User 2025 Season 2 on at
    Screenshot of the condition would help, but I think your overall structure may be incorrect. If you want to run this any time a new contact is added, then I don't see any reason why a "List Rows" action is being used unless you are validating that there are no existing consent records already.
     

     
    Option 1: If you don't need to worry about consent records from other sources
    Trigger: When a contact is added (row is added, modified, or deleted in Dataverse)
    Action: Add a new row (create your consent record and link it to the contact)
     

     
    Option 2: If you need to validate that no consent record already exists
    Trigger: When a contact is added (row is added, modified, or deleted in Dataverse)
    Action: List Rows, find any consent records linked to the contact from the trigger
    Condition: Check if the list rows record returned any values.
     * If no records found, create a consent record

     
    You can check if the list rows action returned any records by using the following in the formula editor:
    length(outputs('List_rows')?['body/value'])
    If that value is = 0, then no records were found.
     
     
    If this response helped, please consider marking as verified so future users can see the resolution. If you have additional questions or problems, please tag me in the response so I receive a notification.
  • Jimmy Passeti Profile Picture
    702 Most Valuable Professional on at
    Hello,
     
    Can you send a screenshot for the condition?
    We need to check it to understand what is happening.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 94

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 69 Super User 2025 Season 2

#3
TAHER Mehdi Profile Picture

TAHER Mehdi 58

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans