Limit enumeration values available for an operator | Community
Skip to main content
salvdangelo
Level 5
April 15, 2019
Solved

Limit enumeration values available for an operator

  • April 15, 2019
  • 8 replies
  • 6383 views

Hello,

I was wondering how is it possible to limit the visibility of the enumeration values in an enumeration E according to one condition specified in an input form (for example current operator group, or one named right the operator owns)

Example:
ENUM E: A,B,C,D

OPERATOR GROUP "OpA" --> Field myValue using ENUM E : dropdown list will show values A,B,C

OPERATOR GROUP "OpB" --> Field myValue using ENUM E : dropdown list will show values B,D

...

Could you tell me how is it possible to do that inside an input form ?

Thanks in advance,
Salvatore

Jean-Serge Biron

wodnicki

pablo.rosero

Amit_Kumar

davidk23955130

Amy_Wong

Adobe Campaign Classic

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by geoffreyl240454

Hi salvdangelo​,

It's possible to do that with this steps:

- Creation of a relation table between the Operators and the Enumeration Values tables (N-N), this table will contains the operatorId and the enumValueId (same principle than between the recipients and the recipients lists).

- Linking the Operators and the Enumeration Values tables with the new relation table.

- Adding a "sysFilter" in the input defined in the input form:

<sysFilter>

     <condition expr="[enumValueOperatorRel/@operator-id] = $(@operator-id)"/>

</sysFilter>

Best Regards.

Geoffrey.

8 replies

geoffreyl240454
geoffreyl240454Accepted solution
Level 3
April 15, 2019

Hi salvdangelo​,

It's possible to do that with this steps:

- Creation of a relation table between the Operators and the Enumeration Values tables (N-N), this table will contains the operatorId and the enumValueId (same principle than between the recipients and the recipients lists).

- Linking the Operators and the Enumeration Values tables with the new relation table.

- Adding a "sysFilter" in the input defined in the input form:

<sysFilter>

     <condition expr="[enumValueOperatorRel/@operator-id] = $(@operator-id)"/>

</sysFilter>

Best Regards.

Geoffrey.

Level 3
April 18, 2019

Can this be done on an operator group level? the goal here not to update the relationship table every time a new operator/user is being created/added to the system.

geoffreyl240454
Level 3
April 19, 2019

Hello Abdul,

It's more complicated to do that with the groups.

Indeed, an operator can be linked to many groups so it's difficult to set the "sysFilter" tag.

If it's possible, I don't know how. Sorry to can't help more.

Best Regards,

Geoffrey.

Level 2
May 6, 2019

Hi geoffreyl24045476​ and salvdangelo

Can we do same configuration at Schema level ?

ENUM Frequency : dropdown list will show values Daily, Weekly, Monthly for operator 1

ENUM Frequency : dropdown list will show values Daily, Weekly for operator 2

Thanks,

Yashdeep

geoffreyl240454
Level 3
May 7, 2019

Hi yashdeepm7845047​,

The principle works with the enumeration values but I unfortunately did not found a way to apply this to the enumerations from schemas.

It is possible to create two enumerations in the schema and call the good one in the form depending on the operator but this solution means that we have two different fields in the database and I think it's not really clean.

Thanks,

Geoffrey.

Jonathon_wodnicki
Community Advisor
Community Advisor
May 7, 2019

Hi,

You can do this with schema sysfilters and joins. Sysfilter you're conditionally appending predicates to the where clause, usually current operator has a right or is admin. I'm not sure how dbEnums behave with schema sysfilters tacked on (to xtk:enum), but sounds like something that should work.

Thanks,

-Jon

July 9, 2019

Sorry i didnt get it

can someone explain this solution in more details

thank you

geoffreyl240454
Level 3
August 6, 2019

Hi salvdangelo​, yashdeepm7845047​, arpandas681683​,

I found a way to filtering very easily the values of an enumeration coming from a schema. In fact, you have just to add a "enabledIf" attribute with a "HasNamedRight('myRightName')":

<enumeration basetype="string" default="A" name="example">

     <value enabledIf="HasNamedRight('OpA')" label="A" name="A" value="A"/>

     <value enabledIf="HasNamedRight('OpA') or HasNamedRight('OpB')" label="B" name="B" value="B"/>

     <value enabledIf="HasNamedRight('OpA')" label="C" name="C" value="C"/>

     <value enabledIf="HasNamedRight('OpB')" label="D" name="D" value="D"/>

</enumeration>

The named right can be applied on an operator or a group.

Please note that an administrator can see all the values even if he haven't the good right.

Regards,

Geoffrey.