Try our conversational search powered by Generative AI!

Can you pass a parameter to a selection factory?



I have a block property that uses a selection factory to provide a SelectOne and the data returned from the selection factory needs to be filtered based on the value of another property on the block.

Is this possible? If so how?

Thanks in advance,


Jun 14, 2017 13:39


One way would be to get access to page itself and then check value of the property:

public class SomeSelectionFactory : ISelectionFactory {
    public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata)
        // depending on master language - returning some stuff
        var masterLanguage =

Jun 14, 2017 15:05

But this apporach is fragile in sense that child-parent depth is not deterministic. From the selection factory perspective you cannot be sure that 1st level parent will always be page itself (thinking about local blocks..).

Jun 14, 2017 15:07

Thanks Valdis, that approach was so close to being able to acheive my result. I can get the value I need but if I then change it, it doesn't hit the selection factory again until after a publish so the list does not get updated based on the new value selected.

Jun 14, 2017 16:43

May be this will be useful :-)

Jun 14, 2017 17:39

Hi Tahir,

That's useful thanks but not quite what I'm after. I need a list to be populated based on the value selected in another property, I kind of have this working but the selection factory is not called if I update the selected value of the other property.



Jun 15, 2017 10:34


You can try and see if it works for you.

Disclaimer: I am the creator of this package. I mostly created it to test creating a EPiServer addon, so I cant guarantee that it works in all versions(10.x) of epi.


Jun 15, 2017 10:56

Hi Peter,

This looks interesting.. :) Mind if I do code review? :))

Jun 15, 2017 11:12

Hi Peter,

That does sound good, sadly we're on an earlier version of EPiServer (7.19) at the moment.

Jun 15, 2017 11:19

ouch, that's vrsion I haven't seen for a while :)

Jun 15, 2017 11:24

Sure, go ahead Valdis:)

Mark, you might need to create a custom editor if you want the options to be updated without reloading the ui. Maybe can help. I can't remember what works and what doesn't work in 7.x


Jun 15, 2017 13:41

Hi, is there any new / updated suggestion please ?

May 05, 2018 16:35
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.