none
Set different 'workflow' actions for each item in the Resources list box

    שאלה

  • Good morning all,

    I have a scenario where i have a workflow and i want to set different actions for each selected item.

    More clarifications, when the user uses the calender to reserve some resources, he will select Room 1 and Projector 1 for example. then i want to start a workflow if Room 1 is selected (for example) the workflow should perform action 1 and if Projector 1 is selected it should perform another action 2. if both are selected, action 1 and then action 2  should be performed.

    I'm trying to build this workflow using the designer, it possible?

    שבת 23 יוני 2012 03:59

כל התגובות

  • Hi Oscar2050,

    I would suggest you to create different workflows for your different item items such as "Projector1", Room1 etc...

    Your workflows will start on "Item Added"

    Now, write the first step of your every workflow as:

    if CURRENT ITEM :RESOURCES contains "resources column values"

    {YOUR WORKFLOW LOGIC}

    e.g. For First workflow the condition would be:

    if CURRENT ITEM :RESOURCES contains "Projector1"

    {YOUR WORKFLOW LOGIC}

    יום שני 25 יוני 2012 04:40
  • Hi Oscar2050,

    You can even achieve this in single workflow by writing your logic for each "Projector1, Room1...etc"  in each different IF Condition.

    e.g IF CURRENT ITEM: Resources contains "Projector1"

    { Workflow logic for "Projector1}

    IF CURRENT ITEM: Resources contains "ROOM1"

    { Workflow logic for "Room1" }

    YOUR WORKFLOW WILL START ON ITEM Created.


    • נערך על-ידי Amien123 יום שני 25 יוני 2012 06:18
    יום שני 25 יוני 2012 06:18
  • Dear,

    The situation is not that straight forward. It’s more complicated.

    Details: the projector 1 will have to go to certain
    participants and the room 1 to different participants

    Those participants are defined within the resources list (I’ve added a
    column in the resources list called participants so when the user adds new
    resource he/she will define who the participants are).

    So when the user selects Room 1 in 'a' list for example it should check the
    resources list and retrieve the participant of Room 1.

    So the condition should be:

    IF the selected resource's participant is equal to.....

    Do certain actions

     

    If I did this condition it will only take the first selected resource and
    ignore the others...

    Hope I clarified my issue well

    שבת 30 יוני 2012 07:10
  • Hi Oscar2050,

    The condition:

    if CURRENT ITEM :RESOURCES contains "resources column values"

    will meet your requirements i guess because:

    Suppose the user selects "room1" and "projector1" then your workflow will proceed as:

    (remember the "Resources" value is "room1;projector1")

    Condition1-

    {

    IF Current Item: Resources contains "room1"              (This will be true a user has selected "room1")

    DO THIS

    }

    Next condition in workflow will be:

    {

    IF Current Item: Resources contains "projector1"              (This will be true a user has selected "projector1" also)

    DO THIS

    }

    These above conditions will not ignore the next values

    יום שני 02 יולי 2012 04:24
  • but i the list will contain lots of items i can't just write a condition for each one.... they are a lot, plus the end user will have the ability to add more in future (like room 2, 3 and 4) so the  new items won't be covered with the conditions and i will have to modify the workflow every time the user add new item in the resources which is not practical at all..

    we have two different list here, the list of the workflow and the resources list (which is contain the room 2, projector and so on). I have created a column in the resources list that will facilitate the things as i said. so whenever the user enter new resource he will add the participants. The workflow here need to check the participant of the selected resources.

    יום שני 02 יולי 2012 05:12
  • Well, it seems that there's no answer... However i think i have an idea which is creating an event handler that retrieve the recipient from the Resources list  to the Workflow list. 

    the idea is when the user enters new resources in the 'Resources ' list he should state the recipient of the entered resources. Then at the Workflow list when the user create new item with res 1 and res 2, the event handler will add a field which contain the recipients of the res 1 and res 2 together so the workflow can create an action for the specified recipients ..

    what you think? however i cannot figure out how to go through each item in the Resources filed of the Workflow list!!!! because the nature of the filed cannot be reached with codes.

    The issue here that Amien's solution is static, it doesn't consider that the resources can be different and the users in future might add more, and with his solution the workflow won't cover the new resources added. Also, Amien's solution doesn't consider that the resources might be a lot like 50 items and creating a condition for each one is totally not preferred

    יום ראשון 08 יולי 2012 05:45