Questions tagged [rules-engine]

For questions related to Sitecore's Rules Engine feature, which facilitates the processing of conditions and actions in Sitecore for personalization and other features, both native and custom

Filter by
Sorted by
Tagged with
17
votes
2answers
1k views

Can I change the order of components in placeholder based on personalization?

I've seen a few examples on how you can use personalization in Sitecore to personalize the way a component (rendering / sub-layout) is displayed on your webpage. However, most of these guides explain ...
13
votes
2answers
606 views

How to invoke other actions in Conditional Renderings?

Another question here (Can I change the order of components in placeholder based on personalization?) got me thinking - maybe there was a way to actually dynamically assign a placeholder to a ...
12
votes
1answer
556 views

Automation Engine can't find custom predicate

I have create a custom predicate according to the documentation: https://doc.sitecore.net/developers/xp/segmentation/create-a-custom-predicate.html The rule has been defined in /sitecore/system/...
10
votes
1answer
323 views

Prepopulate WFFM field with username

I would like to use the rules engine to prepopulate a WFFM form field with the logged in user's username. Unfortunately, I can't seem to get this to work, even though the conditions and actions that I ...
8
votes
2answers
818 views

Dependency Injection for a Sitecore Rule

I've got a Sitecore Rule, based on WhenCondition<T> where T : RuleContext Is there a way to use dependency injection on a sitecore rule? Currently having to use service locator pattern within ...
7
votes
2answers
464 views

Adjust component parameters based on placeholder

I'm trying to add Parameters to a rendering based on the placeholder it's been inserted into. I've been trying to handle this using rules (after reading through this blog post): I created a new ...
7
votes
2answers
347 views

Binary rule for list segmentation

We have custom facets for contacts and these facets are used for segmentation in lists (segmentation rules defined at '/sitecore/system/Settings/Rules/Definitions/Elements/Segment Builder'). ...
6
votes
3answers
229 views

How many personalization rules are too many? At what point does page/site performance start to take a hit?

A client wants to do basic personalization with a rule that changes a header image based on geolocation/zip code. They would like to try and cover as many individual zip codes as possible in a region. ...
6
votes
1answer
549 views

How to group multiple rules to one rule condition?

We are looking on how to consolidate a list of rules under a category or group condition. So, instead of content editor selecting multiple rules on a component, he/she selects something like "where ...
6
votes
2answers
687 views

List segmentation on custom rule YourLinqIsTooStrongException error

I've made a custom rule that enables the user to get a date field from any facet and see if that date's passed. I've made two variants, one for personalization and one for list segmentation/Marketing ...
6
votes
1answer
97 views

Difference between current visit and contact

What's the difference between current visit and contact in the Sitecore rule engine? From the description, it sounds like Current visit is based on the current user session's interaction Current ...
6
votes
1answer
892 views

How do I execute an action when a user clicks a link in an EXM email?

I would like to execute an a rule (condition and action) when a user clicks a link in an EXM email. The ability to trigger a goal would also be acceptable. This seems like a simple request, but ...
6
votes
1answer
189 views

ClientScript.RegisterForEventValidation in a custom RuleAction class

I managed to have my dependent droplists (WFFM dependent drop lists) populated via a custom WFFM RuleAction by using a lot of JavaScript but now since I add dynamically the values in my second ...
6
votes
1answer
2k views

WhenCondition<T> Rule custom code not firing

I need an assist. I'm running into a situation where code that was written for a custom rule is not firing. I have put breakpoints in Visual Studio and the breakpoints are never hit. My solution is ...
6
votes
1answer
371 views

Contact Custom facet not appearing in ListManager

I've setup and configured a custom facet on the contact but we now want to be able to segment on the fields it contains in the ListManager but they aren't available there. What do I need to do to see ...
5
votes
1answer
622 views

A/B testing a product landing page

I am trying to figure out if the following use cases are supported natively in Sitecore 9 or if there would be custom development (and if so, the best approach to leverage): Simplified Test Scenario - ...
5
votes
1answer
130 views

Capture Rules Engine Stack Overflows

It is possible within the rules engine to create a scenario where a set of rules cause an infinite loop. Take for example the following rule that has a When Condition to itself: This example is very ...
5
votes
1answer
888 views

Custom Sitecore rule, define query for parameter item

I am creating a custom Sitecore Rule, in the rule text I need to define a parameter that allows the user to pick an Item using the Tree interface. However the tricky part is that the root needs to be ...
5
votes
0answers
238 views

Check if boost rule has been applied to an item

I am implementing functionality to push certain items in my content tree down in search results depending on a "discontinued" checkbox field. I have created a rule item under /sitecore/system/Settings/...
5
votes
0answers
44 views

Is it possible to personalize content via Xamarin SDK or SSC using rules?

I was looking into Xamarin SDK and Creating a SSC to provide data to a Xamarin App, but I was wondering ... Is there a way to personalize data shown in Xamarin(or any Mobile App for that matter) based ...
5
votes
0answers
61 views

WFFM - Rule Set Editor - Active Directory Federated Identity

I am trying to create a rule for a WFFM email address field to populate the field with the logged in users email address. But, I am not sure what rule to use or if any of the rules will work at all ...
4
votes
2answers
410 views

Is there any way to check Page mode like edit/preview using Sitecore Rule?

Is there any way to check Page mode like edit/preview/normal using Sitecore Rule? I want to render specific field in rendering variant of SXA component based on page mode (editor/preview).
4
votes
1answer
367 views

How to check if contact has ever opened specific EXM email?

I am using Sitecore 8.2 initial release and EXM 4.0.0 rev. 161028 for it. I am creating an engagement plan and I want to create a rule condition which would say "Has contact opened email with ...
4
votes
1answer
509 views

Sitecore personalization rule “goal was triggered during a past or current interaction” not being triggered

Here is what I did: I set Component A to show after Goal A was triggered during a past or current interaction'. Then I triggered Goal A and I was successfully identified as a contact by adding an ...
4
votes
1answer
2k views

Sitecore validation rule at field level in multi-list value selection range

I came across this multi-list field restrictions to limit range(selection) using regex. I got few references to add basic validations. Both work fine. Ref1: ^({[^}]+}\|?){0,5}$ http://www.benramey....
3
votes
1answer
38 views

Insert Options Rules with AND taking precedence over OR

I have a condition that is essentially A and (B or C or D or...). So for the rule to fire condition A has to always be met. And on top of that, one condition of either B or C or D etc. I can't seem ...
3
votes
2answers
647 views

Rule condition with multiselect?

I'm trying to find a way to allow a user to pick from a multi-select list as part of a rule condition, but I'm not having any luck. My exact scenario is that each user on the site needs to identify ...
3
votes
1answer
68 views

Insert Options Rule where Item contains language (NOT Item language is)

My client has 12 sites, most of which have a specific language that the entire site is in. Editors are multilingual and jump between sites, forgetting to change the language in the upper right of the ...
3
votes
1answer
289 views

Converting RuleList back to XML

I have a piece of code to add a new Rule to an Item field but i can't work out how to convert this back to XML, Can anyone point me in the right direction? :) The RuleFactory doesn't appear to offer ...
3
votes
1answer
437 views

How do I restrict mime types on files uploaded through a WFFM form in MVC?

I am looking for a way to restrict MIME Types on files uploaded through a WFFM form. What I am really hoping for is a way to control the allowed MIME Types using the rules engine. Even if the solution ...
3
votes
1answer
169 views

Conditional Rendering Rule Order

Does anyone know how to change the order of the conditional rendering rules when you try to personalize a component? I've added a custom rule that I'd like to show up at the top of the list, but it's ...
3
votes
1answer
135 views

Personalization Rules Chaining

I need to use sitecore rules to personalize the contents that I want to display to users. For example, I configured two basic rules on a component. When used separately, both rules evaluate to true. ...
3
votes
1answer
246 views

Custom Personalization Rule - Geo IP Country not working [duplicate]

I Have enabled Sitecore GEOIP services to my local instance and tried personalization based on country. This not worked as I worked local environment so it returns the local IP address (127.0.0.1). ...
2
votes
2answers
46 views

Custom Personalization rule: hide component if url contains a regex condition

I need to create a personalised rule that hides the component if the url contains a certain pattern and I'm a bit stuck in an early phase. I have two questions: What condition should my ...
2
votes
2answers
204 views

Sitecore personalization based on at least two pages visited from set of pages

I am looking to specify a personalization rules in Sitecore 8.2 where at least two pages are visited from a specific set of pages on the websites for example: Content - Home - car loans (1) ...
2
votes
2answers
126 views

How do I assign the same Conditional Rendering Rules to Multiple Components?

How could a Content Author copy a Conditional Rendering Rule from one component, to many others? I think the best solution would be to set the Conditional Rendering Rule on the Data Template of the ...
2
votes
1answer
634 views

Some Sitecore 8 conditions for conditional renderings seem missing in Sitecore 9

I tried to use some of the OOTB conditional rendering rules for personalization I had running in a Sitecore 8 instance, after upgrade/migrate to Sitecore 9 and ran into the fact that some of them no ...
2
votes
2answers
276 views

How to display a field value in rendering variant only if host name matches?

I need to display a field value only in a certain domain. Iam using rendering variant with below rule enabled but not able to see the value coming even in the domain 'sc9.local'.
2
votes
2answers
91 views

Automatic asset replacement at a fixed time

We want to schedule an automatic asset (graphic, text etc) replacement. Here is my plan that makes the purpose also clear. I want a particular image to get automatically replaced at midnight on ...
2
votes
1answer
107 views

How to handle insert rules in multisite environment?

I've got some insert rules defined for my website, now I have to convert this into a multi site solution. My current insert rules apply to the new site. How can I restrict insert rules to work only on ...
2
votes
1answer
586 views

Rule to set datasource based on search result

Using sitecore 8 (8.2 update 3 to be specific) I'm looking to be able to create a rule based on some condition which will set the datasource (and maybe rendering) to the most appropriate result from ...
2
votes
1answer
143 views

Device Detection Rules not triggering

I am using Sitecore 9.0.1 where I have created a new device (in the name of "AMP") item under layout/device in my content editor. I would be configuring Layouts/Renderings (AMP files) in my page ...
1
vote
1answer
187 views

Missing personalization rules around GeoIP

I'm trying to set up and test GeoIP personalization rules in a Sitecore 9 instance. However, when I go to personalize a page or component, the GeoIP section of the rules is missing. I've compared ...
1
vote
1answer
97 views

WhenCondition not executing Sitecore 9.2

Sitecore 9.2 I'm trying to create a rule and execute a script but I can't execute my code from the Script reference. My objective is to show Form B instead of Form A when the script returns true. ...
1
vote
2answers
54 views

upload rules from csv file

I need to create segmentation rules for showing a banner in my site based on zip. It is difficult to create rules for each zip as there might be 1000s of zip code. Is it possible to create and ...
1
vote
1answer
77 views

Overlapping rules

I am trying to create two versions of our homepage for two different types of clients, based on their site tendencies. I can get the page to function as desired with either of the two client ...
1
vote
1answer
309 views

General Link Dialog “InsertLinkViaTreeDialog” misses InsertLinkRules after Upgrade to 8.2u2

We recently upgraded from Sitecore 8.1u1 to Sitecore 8.2u2 and noticed that the general link field dialog "InsertLinkViaTreeDialog" has a different structure now. We had a custom field that was ...
1
vote
1answer
39 views

Validation problem with checkbox when using Rules Validation Rule

I've created an item rule using the Rules Validation Rule template. The rule ensures that there is a value provided for EITHER a specific text field OR a specific checkbox field. The rule works fine ...
1
vote
1answer
416 views

Unit testing Sitecore custom rules

For a project I am using a bunch of custom Personalization rules, the only problem I am facing at the moment is that it takes quite a while to load the rules and I can't find any good examples of a ...
1
vote
0answers
54 views

Save Item Rule - Inserting item causes recursion

I am using the rule engine to insert a branch template under an item on Item Save. The problem is that each item in the branch subsequently triggers Item Save. Is there a way to prevent the branch ...