Closed (fixed)
Project:
CiviCRM Entity
Version:
7.x-2.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
3 Sep 2018 at 11:26 UTC
Updated:
30 Aug 2021 at 15:39 UTC
Jump to comment: Most recent
Hi. I am trying to create a rule when content is updated or saved for the user directory the email field specified in the directory is created as a CiviCRM contact and tagged or added to a group. I am following some of the basic instructions here - https://www.drupal.org/node/2854256
However, when I try this I get an http 500 ajax error. Is this a bug or configuration issue? I tried a number of options but none seem to work.
Comments
Comment #2
markusa commentedDo you see any errors in the Drupal log?
It could also be helpful if you posted the export code for the Rule here so I can look at it and understand better what you are doing.
Comment #3
sohal khatwani commentedHi @markusa - Thanks for the quick reply. By adding the views integration to the database this issue seems to have been resolved for the node author. However it does not work when you create a new user account as an entity and then try to assign them to a group. Also can we use CiviCRM entities to dynamically assign users to a certain group based on a select list in the content type? Export of my rules is below.
Comment #4
markusa commentedYep, Views integration can be necessary...Glad you got that fixed...
For the last action, the group assign, have you tried doing the action on 'civicrm_contact', instead of 'entity-fetched:civi-user:civicrm-contact'
It should be available to the action, provided by the 'civicrm_entity_action_load_create_contact' action.
Comment #5
sohal khatwani commentedThanks @markusa.
I did that and got it to work. Thanks.
Is there a way to dynamically have a group selected based on a category a user chooses in a node?
I am exporting my rules code below. What it does.
On a node update (You can change it to node create) it captures the email address from the node i.e. directory and creates a new Drupal user and CiviCRM contact and assigns that contact to the group.
Comment #6
markusa commentedIt would be possible to use the Data selection for the "Civicrm Group" parameter, but you have to build a variable in Rules of type "List of text."
Basically an array of strings, or group titles that you want assigned.
So you'd have to probably have the term names = the group titles ...
Comment #7
dsdeiz commented