cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Check item exists before adding

Jump to solution

Morning all

So I have a ridiculous requirement whereby I have to copy items from ListA to ListB if a condition is met in ListA.  i.e. if new item added to ListA with status of Live then copy to ListB.  ListB looks exactly the same as ListA but has an additional column called ListAID.

So when the workflow runs I need to work out if the item from ListA already exists in ListB.  Fine, happy with that, I query ListB filter by where ListAID = Item Property: ID and store the output in a list item variable vIDListBItem.

So now I need to know if vIDListBItem has a value.  I choose set a condition and configure as follows:

  • If any value equals value
  • Workflow Data:  vIDListBItem
  • {here is the problem}

The only comparisons I have are "equals" and "not equals".  I would like to say is not empty.  But that is not possible. 

Now I have a few ways in my head I can get around this, but I would rather not do them as I think I am over complicating it.  Can someone please tell me an easy way to do this...?  ‌ you always come up with tricks that I never knew about - how would you approach this?

Labels: (2)
0 Kudos
Reply
3 Replies
Workflow Hero

Re: Check item exists before adding

Jump to solution

Hi Cassy,

I'm busy building a workflow to interface changed records. I stored the result of my Query List action in a single-line text variable. In my Set a Condition action I had the "is empty" option.

Reply
Workflow Hero

Re: Check item exists before adding

Jump to solution

exactly what I was about to suggest.

I assume ListAID column in list B is of some numeric or single line text type. so it doesn't make too much sense to have 'item ID'-type variable in workflow for it.

so store it in text variable in workflow and you can easily check for emptyness

so no trick in this case at all.

hope you are not disappointed

Reply
Workflow Hero

Re: Check item exists before adding

Jump to solution

I made the variable a string - was hoping there was a cool "does item exist" trick that I wasn't aware of.

Thanks both. 

0 Kudos
Reply