locked
Using SPD Workflow to tell me which column is a duplicate entry in list and writes to column the duplicate item ID RRS feed

  • Question

  • I have this workflow that checks for duplicates in the list. and then it should write to the duplicate column which ID already in the list is the duplicate item.

    but right now it just see's the new entry as the duplication, I was wondering if anyone could point out in the workflow code where the logic is flipped  around?




    it should be seeing List item id 80 as the duplicate as this is new item id 89
    Friday, November 24, 2017 11:04 PM

All replies

  • Hi,

    I’m not very clear about your request, please provide more detailed information as below:

    Whether you need to compare the current item column values with the other existing list items’ column values, then if there is same value, write the duplicate item’s ID into a separate column?

    If so, how many columns do we need to compare?

    Please provide detailed steps of your requirement. It is best to provide the screenshots about this list.

    Thanks,

    Carl Zhou


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, November 27, 2017 9:11 AM
  • We are comparing 1 column. if the new item, is all ready in the list, then the new item is submitted into the sharePoint list, but the column ID # that is in the list prior is then placed in the Duplicate Column

    IE:

    Printer seven is already in the list. So ID # 86 should be where #89 is

    Column
    Duplicate
    ID#86 is a duplicate

    Columns:
        ID                           Duplicate                                           Name





    Monday, November 27, 2017 5:57 PM
  • Hi,

    You can create a workflow and add a loop by SharePoint2013 Designer to achieve the requirement.
    When you create an item, the workflow will set the Duplicate to the same item ID.
    Below is a similar demo that helps you understand better.

    Background: 
    I created a list named “listA”, which contains four columns: ID, Title, Duplicate, Name.
    I created a List Workflow for “ListA”, it will loop all items and get the duplicate item ID.

    The details are as follows:

    


    Result:

    Here is a demo about how to loop list items using designer workflow for your reference:
    https://weblogs.asp.net/ricardoperes/looping-through-list-items-in-sharepoint-2013

    Thanks,
    Carl Zhou


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Edited by Carl__Zhou Tuesday, November 28, 2017 2:40 AM
    Tuesday, November 28, 2017 2:27 AM
  • I have a couple of Questions concerning this solution,  as right now I can not get this to work with the example you provided.

    Question:

    1)What are your parameters of the dictionary? As there are a lot of items like,  ID, Name, List, that when I try to use the Get dictionary items it doesn't see those variables, do I need to add them somewhere? do I add them to the Build Dictionary which is line 2 of the workflow?

    2) I see where at the start of Stage 2 we get a count of the variable  list, but  I can not seem to do the next line as the dictionary doesn't have list.  where or how did you get the variable list ?

    2) what URL did you mask out? is that the List URL or the site URL ?  I believe it is the List URL?  but want to confirm.

    3) the Client it asking if the new item being entered, is say 8 days after the duplicate then there is no duplicate.

    So the prior item Created and the  New Item Created has to have at least 7 days  before a new item can be entered with out it being a duplicate entry.

    So if the prior item was entered on 11/1/2017 and the new entry is  11/5/2017 = Duplicate

    But if the new item is 11/8/2017 then there is no duplicate. How would I add that logic to the workflow?

    when I try to do the variable:NewID not equal to Current item:ID
    I can not use the current item ID, it wont let me click the OK button, any idea why that might be?



    I get this error on the http web service

    Tuesday, November 28, 2017 3:47 PM
  • Hi,

    About your first question:
    This is my local variables.
     
     
    About Build Dictionay:
     
     
    In the demo about how to loop list items using designer workflow, it has a detailed introduction, when you create the loop, you will create the corresponding variables.

    Second question:
    The URL use the new REST API, for example: http://sp2013/_api/web/lists/getbytitle('Tasks')/items.
    About the URL, the demo also has a detailed introduction.

    Third question:
    Add this three actions in your workflow:
     


    Please read the demo I provided, combine the workflow I created, try to recreate it, check if it works fine.

    Thanks,
    Carl Zhou

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, November 29, 2017 8:22 AM
  • Question #1 

    various issues noted in the screen shots:

     I had to in the url  have no spaces in between the list name words .. 

    I have also used the  List name with the Spaces in it,  and got the workflow to run  using '[ListName]'/items

    and I got it to run using  '"ListName"'  but the responsecontent is still blank..


    Wednesday, November 29, 2017 3:50 PM
  • Hi,

    In your workflow, you need add loop. Please follow the workflow I have provided.

    About the URL, you can test in browser. 

    Input the URL in the IE, click Enter, if the URL is correct, you will see the page like this:

    

    Thanks,

    Carl Zhou



    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, November 30, 2017 2:27 AM
  • there is a Loop.. I cut to loop off in the pic above . but the loop isn't doing anything.

    Yes, in Chrome I see XML in IE I see this below when I use the url ...

    but when I use the url in the workflow I get the above issues.....

    Thursday, November 30, 2017 10:31 PM
  • Hi,

    Can you provide a screenshot of your final version of workflow and your list?

    In your workflow, you can add log action, check which action your workflow run to.

    Thanks,

    Carl Zhou

      


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, December 1, 2017 1:47 AM
  • I have log to History all over the workflow.. Sure I will , but it is the same workflow. it has to do with the URL .. it is not bring any response back to the code. As you see I used the Log to history A LOT........

    Let me know if you need additional information concerning the workflow.. as it isn't working it stops at the Build Dictionary step.

    this is where it stops the logging to the history; The next step is the Call HTTP   and it doesn't get logged, so that tells me there is something going on with the url.  but the URL works if I put it into a browser. Chrome it shows the XML and IE I get the images in the prior post.

    This is what I get when I use the URL in IE:

    XML  from Chrome when I use the  URL

    Here is my list:





    CARL:
    I actually got this workflow below to give me a count of the items in the list using the same URL that I'm using above.  My question is now how do I get it to see the Name  etc..  and then if there is a duplicate name  tell me which ID is the conflict..

    Friday, December 1, 2017 3:22 PM
  • Hi,

    If you want to check all item in this list, you have to use loop in your workflow.

    About the demo that I provide:

    https://weblogs.asp.net/ricardoperes/looping-through-list-items-in-sharepoint-2013

    You need to set the properties for the Call an HTTP Web Service action:

    Please refer to my workflow:

    Thanks,

    Carl Zhou


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, December 4, 2017 5:42 AM
  • See Above issue remaining

    Monday, December 4, 2017 8:07 PM
  • Now workflow isn't even working...  not sure what is wrong, I'm not using the GUID of the List I'm using the list
    name.


    Monday, December 4, 2017 11:08 PM
  • Carl:

    the biggest issue is that the created  column in the SharePoint list is formatted different then the  created column in the xml .

    how can we resolve the time stamp issue with out having the workflow break apart.

    Tuesday, December 5, 2017 7:29 PM