I have created an external content type and successfully was able to pull data from our sql table. However how do I pull data using the BCS action in Nintex?
I have a list where I have added the BCS action to it
This is how I configured the action:
When I click on the Run Now button I get the following to display:
My question is how do I populate this data in my list? I got it to run successfully in the action but I want to be able to retrieve the data from the sql table into my list.
Solved! Go to Solution.
While I am fairly new to Nintex as well, I believe you will want to use a For Each loop to look through the collections (assuming you made the storage variables collections). Then, depending on how often you want to write back to the list, you either write back within the For Each loop so you write everytime, or you have some conditions within the loop to only write back to the list based on those conditions.
So what I would do is store each value you're pulling in a collection (so make txtDate, txtCallDate, and txtCompany collections), create a For Each loop to loop through one of them assigning it to an index, then within the For Each loop make Run Parallel action with 3 collection operations, one for each Collection, which looks in the proper collection, at the index you assigned in the For Each loop, and assigns it to a variable. So now each time it loops through you have all 3 items assigned to a variable and can write them to a list.
This gives some good information:
I think I am almost there! I appreciate your help. This is what I have so far. Just so you know, my external content type has 19 records.
After I made changes to my workflow based off of what you have mentioned the last record is what populated in my list. I need all 19 items to populate in my list.
So my workflow settings i have set it to start when a new item is created.
ForEach looks like:
The first collection on the left is :
Second collection in the middle is :
The third colection :
my variables txtID, txtDate and txtCollectorCode all are being set on single line columns. I manually ran the workflow on an item that I had in my list. What ended up happening is it populated the 19th record in my list instead of populating all of them.
Wasn't it supposed to retrieve all of the items? I don't have a condition set in the workfow yet, as you have mentioned to do in your post, but what I need is the workflow to run on new items being entered into the table.
You are the best for helping me !
I think instead of "Set a field value", you should be using "Create Item" and just add each variable to that one item. That way each time it loops, it creates a new item and adds each value.
At least I hope it's that simple
Steven I had a question. Doesn't the BCS action run on real time data? Meaning when a new item is added to the external content type wouldn't this trigger the workflow that has BCS connection to run? when I manually run the workflow it pulls all the data in. However when a new item is added to the external content type it doesn't retrieve that item in unless I manually run the workflow again.
I am sure I can create a schedule for the list that I have created that will run every 15 minutes, which is fine however I am ending up with a lot of duplicate items being copied back into my list. Suggestions?