Solved

Capture field based on another field

  • 1 August 2017
  • 5 replies
  • 5 views

Badge +7

Hi,

 

This seems simple but I am thinking that I am missing something here.

 

I have a row (below is the row with title)

 

Item Name (unique)    Email?         Email Address

Item1                           Yes            name1@email.com

Item2                           No              name2@email.com

Item3                           Yes            name1@email.com;name3@email.com

 

 

I am querying the 'email' column and trying to email the adjacent email address if the result is 'Yes'. How can I go on to do this? (How can I tell the workflow to grab email address if the email column says 'Yes')?

 

The email would say 'item1 is due' (that is the purpose)

 

Thanks in advance!

icon

Best answer by bstori 1 August 2017, 22:44

View original

5 replies

Badge +7

What you need to do is use the Query List Action.

Select Your Lint then in the Filter Section choose the radio button to Select Items only when the Following is True.

Query: Column (Email) is equal to Yes

You can leave all the defaults, and then scroll down to the columns you want to select and then select Email Address.

Output: emailAddressCollection data type is collection.

Then you will need to do a For Each Action.

The For Each would be....

Input: emailAddressCollection

Output: currentEmailAddress ( new var of type string)

Key: index

Within the for each you would add what actions need to happen for example your Send Email Action that would send an email to currentEmailAddress letting them know item 1 is due.

Also, have you thought about use Tasks (Assign A Task) and the built in reminders that will get emailed out based on a due date? Not sure what your overall plan is, but if a new item get added to the list, you can assign a task with a due date to the Email Address column and then use the Reminder and Escalations to send out other emails....Just a thought....

Badge +7

Hi ‌,

Thank you!

I've done this and it works. For some funny reason, this happens

Inside query, although I said 'Select items only when the following is true' and set it as 'Email' equal to 'Yes', it is only sending to the ones that are 'NO'. So what I have there now is set as 'Email' equal to 'No'

Since it works one or another way, thank you!

Now the question is, how do I get the respective 'item 1' (which is the file name) and mention it on the email?

This is been the thorn of the whole thing.

Note: This is a site workflow - business do not want to schedule it

Thanks for the help so far!

Badge +7

‌ ... I didn't know it was a site workflow. You will need to switch it up a little bit. 

Here is a quick workflow I did to help you out. As you can see I am doing a query list and getting an List Item ID Collection 1st. Then in the For Each I am looping through and then doing a Query List by CurrentID to get the Title and the email. You can replace the last log to history with a Send to Email Action. I think this should get you what you need. Also, if your yes/no column is a checkbox you might need to pass in a true/false for the yes/no.

1st Query List Action

For Each ID 

Query List By ID...In this action you get more than 1 column back, so you can get the Document Name and the Email address in one query.

Badge +7

‌ Thank you so much! The fact you made a query, tested it then took screenshots and posted it means much to me. Thanks again for your valuable time! The answer is really clear!

Badge +7

‌ your welcome, glad to help out.

Reply