0 votes

Hi,
is it possible to combine conditions with AND and OR in one action?

For example:
if the Operation succeeded AND
the 'Department' property equals 'Marketing' OR
the 'CustomAttributeText1' equals 'Yes' then

Action

thank you in advance,

Napoleon

by (700 points)

1 Answer

0 votes
by (18.0k points)
selected by
Best answer

Update 2018

Starting with Adaxes 2018.1 it is possible to have Else If and Else blocks in business rules, custom commands and scheduled tasks. This way you can have conditions combined the way you need. For examples, have a look at section Else If and Else Blocks of the following tutorial: https://www.adaxes.com/tutorials_AutomatingDailyTasks_AutomateUserProvisioning.htm.

Original

Hello,

Currently it is impossible to combine conditions with AND or OR operators. However, you can use the If PowerShell script returns true condition.


Here is the script for the condition:

$Context.ConditionIsMet = $False
try
{
    $department = $Context.TargetObject.Get("department")
}
catch
{
    $department = $NULL
}

if ($department -ieq "Marketing")
{
    $Context.ConditionIsMet = $True
    return
}

try
{
    $value = $Context.TargetObject.Get("adm-CustomAttributeText1")
}
catch
{
    $value = $NULL
}

if ($value -ieq "Yes")
{
    $Context.ConditionIsMet = $True
}
0

Thanks it works fine ;)

Related questions

0 votes
1 answer

My scheduled task works like this (these are my action sets) Condition(s): Account is expired and home drive exists Action The user's home directory gets archived Condition(s): ... set? I do not want to split the scheduled task into two! Thanks in avance!

asked Apr 7, 2022 by lehnen (20 points)
0 votes
1 answer

Hello, How it works if I have multiple accounts in one domain, and other accounts in others domains managed by Adaxes ? Thank you. Regards. Pierre

asked Jun 9, 2021 by pierre.saucourt (40 points)
0 votes
1 answer

I'm trying to combine these two scripts to effectively store a user's group memberships in customattributebinary5 and then be able to copy and paste those memberships to a ... ) $Context.LogMessage("Added the user to group '$groupName'", "Information") }

asked Jan 24, 2020 by yourpp (540 points)
0 votes
0 answers

Hi Support, how do I check if extensionAttribute9 was filled in (regardless of its value) when employeeType (which in our case is a dropdown with different values) is set ... with some sort of remark to the initiator if it wasn't? kind regards Ingemar

asked Feb 1, 2016 by ijacob (960 points)
0 votes
1 answer

Good Afternoon, I have been looking through the forums and I might have missed it, but here's what I'm looking to do I currently have a business rule that is being ... another set of different conditions. Let me know if I need to explain my request further.

asked May 12, 2014 by jtop (680 points)
3,411 questions
3,108 answers
7,912 comments
545,843 users