Workflow email with lookup fields

rss

Posted by jorge.ramos - Jun 3 ’16 at 02:33

I have two subsites; Asset Management and HR. The HR site has a list called Employees, which contains the name of every employee. The Asset Management site has a list called Tracking, which is used to track equipment, this list has a lookup column to the Employee list in the HR site to lookup employee names. I created a workflow with SharePoint Designer 2013 to send me an email every time a new item is created in the Tracking list. When I try to add the value of the column that has the employee name, the workflows fails to complete due to an error that says “the lookup is in another web”.

 

How can I display the value of the lookup field in the email body?

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 8 years 2 months 15 days
    #1 by Dmitry Kozlov Jun 4 ’16 at 04:27

    Hi,

    Unfortunately, SharePoint does not support cross-site lookup columns in workflows.

    As a workaround, you can to get value from the lookup field with the help of our workflow action 'Get Items by Query'. You can specify a simple query like this:

    <View>
        <Query>
            <Where> 
                <Eq>
                    <FieldRef Name="ID" />
                    <Value Type="Counter">ID of the current item</Value>
                </Eq>         
            </Where>
        </Query> 
        <ViewFields>       
            <FieldRef Name="The internal name of the lookup field"/>       
        </ViewFields>
    </View>
    

    Replace the highlighted text with corresponding values.

    Then you can get the value with 'Get an Item from Dictionary' action by using the path: (0)/FieldValues/The internal Name of the lookup field.

    Next, you can use the lookup ID to request the user field.

Displaying 1 to 1 of 1 messages