cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerappsUser5
Helper II
Helper II

Assign Web Role for the Portal contact

Hello Experts!

I am trying to create a CRM workflow to automatically assign web role for the Contact records. I have some custom web roles. When a contact is created on the portal, I need to assign the web role to the user based on some conditions. While creating a contact, I need to select the User Role from an option set which has option for Admin, and Agency. When Agency is chosen I need to select a value from a lookup which contains different agencies. When I choose agency as "Agency 1" I need to assign a custom web role called "Agency 1" to that contact record. I tried creating workflow referring to the document below.

https://community.dynamics.com/crm/b/thinkdynamicdodynamic/posts/automatically-assign-webrole-to-the...

But it does not seem to be working. Could anyone please help me to achieve this?

Your help is greatly appreciated!

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
ragavanrajan
Super User
Super User

Hi @PowerappsUser5 , 

 

   The new way of achieving your need is via Power Automate. Here are the steps for your reference. 

 

Create an instant flow: 

 

Steps:

 

Using Common Data Services Current environment  

 

1. Initialize a variable of your choice and set it type to "Boolean"  Ex: ContractNameFlag

2.  Then set the newly created variable to relevant entity- 

3. Create a if condition using the newly created value  check if it is true 

4. Using List Records in CDS current environment > Pick the "Web Roles" Entity 

5. Then using "Relate Records" action > pick the contact Entity  > choose the relationship "Web Role - adx_webrole_contact". Map the URL to "ODATA id" 

 

Here is a snap shot for your reference.  You can customize your logic depends on your description. 

 
 

RelateRecords.png

 

I am also adding a blog which is worth reading 

 

https://www.inogic.com/blog/2020/02/associate-disassociate-two-entities-with-1-n-and-n-n-relationshi... 

 

Hope this helps. 

 

------------

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

View solution in original post

1 REPLY 1
ragavanrajan
Super User
Super User

Hi @PowerappsUser5 , 

 

   The new way of achieving your need is via Power Automate. Here are the steps for your reference. 

 

Create an instant flow: 

 

Steps:

 

Using Common Data Services Current environment  

 

1. Initialize a variable of your choice and set it type to "Boolean"  Ex: ContractNameFlag

2.  Then set the newly created variable to relevant entity- 

3. Create a if condition using the newly created value  check if it is true 

4. Using List Records in CDS current environment > Pick the "Web Roles" Entity 

5. Then using "Relate Records" action > pick the contact Entity  > choose the relationship "Web Role - adx_webrole_contact". Map the URL to "ODATA id" 

 

Here is a snap shot for your reference.  You can customize your logic depends on your description. 

 
 

RelateRecords.png

 

I am also adding a blog which is worth reading 

 

https://www.inogic.com/blog/2020/02/associate-disassociate-two-entities-with-1-n-and-n-n-relationshi... 

 

Hope this helps. 

 

------------

 

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (80,778)