sharepoint workflow to create a new item in another list if it's not already existing - sharepoint-2010

I have two lists, A and B.
I want to create new item in list B once I submit an item in list A.
But, I want to check first if the item already exists in list B. If it exists, just update the existing item or delete it and create a new item instead.
can I achieve this using workflow?

Yes, that should be doable. If this is a list workflow, I assume there is one field in the current item (Let's say "LookupID") that is the unique key (let's say "Title") for the second list.
Set a workflow variable to retrieve the ID of List2 where "Title" equals "LookupID". If the variable contains a value, you can use it to update the existing list item, else create a new one.

Related

How to get primary key and save it in another table with a different page

I have a table am calling stands with pre-existing data, on each particular record there is an option to assign that stand to an entity called exhibitor. The Assign button takes me to another page where am able to fill in information about the exhibitor who now owns that stand.
Exhibitor formStand table
How do I apply the one to one relationship in a case such as this
You could try passing the primary key you need as a parameter in the route to your following page. You can then create an input in your form to hold that value and retrieve it with your other inputs.

Add list to a specific column of DataTable

I'm new to uipath and working with list and DataTable.
I do know how to add data in DataTable from same list using Add Data Row activity in for each activity. But I don't know how to add data in DataTable from two different lists. Because in for each activity you have to give name of one list to iterate.
I really appreciate your help. :)
Use For Each activity, but iterate over Enumerable.Range(0,yourList1.Length-1). This gives you enumerable of numbers, from 0 to max item on your list. Than when in For Each part, you add row, and you call value from yourList1(i)
ForEach i in Enumerable.Range(0,yourList1.Length-1)
dt.addrow(yourList1(i),yourList2(i))
next i
Now, the issue here is, whether both of your lists are the same length, to not to run in out of boundaries error, and whether corresponding items are on the same index(i)
Even better solution is to have datatable where in one column you store values of list1 in other column list2
Or to have List(of array) where array has 2 members, one coming from list1, and second one coming from list2.

Lookup column exceeds List View Threshold

I have created a list which contains records/list items more than the list view threshold which is 5000.
I have also created a site column (as lookup) which points to a column in this parent list.
I have added this site column to a library. And I uploaded a document. But when I edit the properties of the document, I could not update value for this lookup column. The error is showing as:
This is a lookup column that displays data from another list that currently exceeds the List View Threshold defined by the administrator (5000).”
So I have indexed this column in the parent list. from list settings -> indexed columns -> add a column
But still I'm getting this error.
The details of column in parent list is given below:
Type: Single Line of Text & Not Unique
As a workaround, we can use SPAutocomplete of SPServices library/REST API to avoid List View Threshold issue. Check the articles below.
Similar thread
Automatic Parent/Child List Relationships for Large Lists in SharePoint

SQL, when adding a field to database put in two fields and modify

I have this database setup:
http://sqlfiddle.com/#!12/b2989
I want to add a record called "solrID" under item where I already have "ID".
Is it possible to have SQL setup so whenever an entry gets put into ID I also add the same value into SOLRID, except I start it with the text "app".
Therefore, when I add a record to my "item" table, ID autoincrements to have a value of say "2" then I want SOLRID to automatically have the value "app2".
Is this possible?
Two choices that comes to mind is create a view that creates solrID on the fly, or if you really want to have a column that stores what is basically redundant data you can use a trigger to populate solrID.
For me, knowing only what I know from your message I would consider using a view unless you have a really reason to store solrID in the actual table.

How to validate field in InfoPath against separate SharePoint list

I have two SharePoint Lists. One is a simply a list of items with a title and description, the other is a list of requests which contain a workflow. These requests are requests for adding or updating items in list A.
I want to validate the Title field on the add new item form for the Request List. I'm wanting to check that the Title does not already exist in List A.
I know can set the properties to only allow unique values on the Title for List A but as these request are going into a separate list I am not sure how I can check to see if the item already exists in List A.
I am creating the forms for the Request List in InfoPath.
Any ideas would be great.
This is a rough idea, but you could load in List B into your data form and set a textbox to the value of the list, filtered by the title field from list A. If the field is blank then you know it doesn't exist already.
This blog can help with the loading and filtering of the list data:
http://pravahaminfo.blogspot.com/2011/05/filtering-sharepoint-list-data-using.html