Query list and pull only items with numbers in a specific field

  • 28 October 2019
  • 1 reply
  • 3 views

Badge +3

Hello, 

 

TIA for reading my post. I have a large list, 14,000+ items right now, that we use to track collection efforts. We use lookups to a Master Property list to populate things like State, Hotel Name, Inn Code etc. We had an error in the InfoPath form and a large number of items were populated with the ID of the list item rather than the Hotel Name as intended. I'd like to use a workflow to Query the list and filter for only items who have the ID number rather than the hotel name in that "Hotel Name" column so that I can then update the items to have the correct value. Is is possible differentiate and filter this way on query? Thanks for any and all help.


1 reply

Badge +12

@chubacher85 .....in your case I'll recommend below approach:

 

  1. Query your list and get ID & Hotel Name as collection (get any other fields too if you're going to use it for your 
    Hotel Name item property)
  2. Create a variable "num_Index"
  3. Now for each ID collection store it in integer variable and also store the index value in num_Index
    1. Using collection operation(s) and num_Index variable get values from other collections of query list
    2. Add Run If action and see if the Hotel Name "contains" ID (this is your workflow variable from for loop) on which for loop is running 
    3. If it does then do your manipulation or else skip it
    4. If you update Hotel Name using either Set Field Value or Update Item, add Commit Pending Changes after updat action

Reply