Copy column information from library to a list


Badge +9


I have a library with a few columns. What I want to do is copy the column information into an existing list. Both the library and list have the same columns set up. I don't want to copy the attachment or anything. I just want a few column information to copy over, but unable to do so. I used 'create item', 'copy item' and nothing seems to be working.

 

Thanks

Rency


18 replies

Userlevel 5
Badge +12

This is easier than you might think

 

1) Use Query list to query the library for the columns you need and store in variables.

2) Use create item filled with those variables.

 

Done.

Badge +9

Love it!!

Your the bomb Mike. happy.png

Userlevel 5
Badge +12

happy.png  Glad to help and thanks!  

ps:

Mark my answer as correct if you would, so it'll help others too.

Badge +9

Hi Mike,

I just ran into one minor issue. I was successfully able to create the item and pass a few column information over thank you so much for that.

However, I have a column which is a drop down field and another field which is a multiple line text field and unable to get information to populate in my other list.

I did create a few variables (single line, choice, multiple lines of text, etc)  and tested it out,nothing worked.

Userlevel 5
Badge +12

What type of variables are you using to store the values in?   I used a Multiline text variable to store the multiple lines of text column, and text variable to store the selected choice from the column.  Also, the target list, the one in which you are creating the items, should probably use something like a single line of text field for storing the choice selected from the source list.

Let me know if that helps.

Thanks

Badge +9

Hi Mike

For both of my lists both columns are set up the same way. ColumnA is a choice field and ColumnB is a multiple line text field.

As far as the variables being used I have created a single line variable for ColumnA and a multiple line text variable for ColumnB.

I am using the variables in the Query list action and then in the create item so that it  can be passed to the second list.

However these two fields won't pass the values over to my list.

Thank you so much

Rency

Userlevel 5
Badge +12

Hi Rency,

In your target list, I would change the choice field to a single line of text - because you will only be storing the one value that you select from the source list.   You are only selecting 1 value from the source list right?  Give that a try to see if it changes anything.

Thanks

Userlevel 5
Badge +12

Also, can you check the Workflow history and see if you are getting any errors / or if your workflow is stopping at any action?

The reason I ask is because I was able to use a choice in the target and source without error.

I'm wondering if it isn't something else in the workflow that is actually causing this.

Can you post some screen shots of the workflow also?

Thanks

Badge +9

workflow1.png

querylist.png

createitem.png

Hi Mike

Thank you so much for helping me. On the target list I have created a single line text column and the value still did not pass.

The column that I am testing is called CertifiedName which is on the Target list. the notesvariable is a simple single line text variable.

Badge +9

Hi Mike,

Yes I am just passing one value to the targeted column. Also I just checked the WF history and did not see any errors and the wf went through the actions without skipping.

Userlevel 5
Badge +12

Can you log the values of the variables you get back just after the Query List action.  Let's make sure they are being filled.

You may have to include a "filter" to target the doc in the source list that you want, otherwise you'll just get back whatever it returns first.  Logging the variables will let us know.

Thanks!

Badge +9

Hi Mike,

I added the filter to the query list action and the columns that were populating stopped populating so I had to remove the filter.

I added Log in History and noticed that no values were being returned by the variable that was set to the Certified name column.

The other variables returned values perfectly fine.

So with the first list the Certified By is a SP choice column with two choices.

The variable is set to single line text and the Targeted list has a column called CertifiedName that is a single text column that should save the value from the variable. Not sure why it is not working for this choice column.

sad.png

Userlevel 5
Badge +12

Hi Rency,

I'd recommend targeting one specific document in your library where you know for a fact that the Certified name column has a value.   Do this by hardcoding a filter that will work just for that one specific document (we can make it dynamic after we get it returning all the right values).   See if Certified name column then returns that specific expected value ---- make sure that a value has been selected for that document in that choice column.  

Let me know the results of this test.


Thanks

Badge +9

Hi Mike,

It is working now. It was user error....meaning ME. I was querying off of the wrong list. I guess staring at it all last week I must've switched it to the wrong list in the Query action on accident. I decided to look at it today with fresh eyes and noticed my mistake. It is working now and the choice value is saving to my targeted list now. happy.png

Thank you so much for helping me out. happy.png

You are awesome.

Best,

Rency

Userlevel 5
Badge +12

Awesome!  Glad to help.  Make sure to mark this one resolved. happy.png

Userlevel 5
Badge +12

Hi Bob,

Sure you can - we are talking about the Query List action inside of a workflow correct?  What sort of issues are you running into?

-Mike

Userlevel 5
Badge +12

Hi and welcome to Nintexland then happy.png

So really this will depend on your initial design choice.  If you have a list based workflow then inside of the workflow the people picker will already exist as an Item Property that can be used throughout your workflow.  In other words the user would select this person on the form and since the people picker control is connected to the list column, you will already have access to the selection inside of your workflow with no further need to do any other query.

However, if you are using a Site workflow, which is not connected to any particular list, then you will use the Query List action to go out and grab some values from a list.  If you are targeting a single value you can create a person variable inside of the workflow and put a filter inside of the Query List action to grab a specific person to fill this variable with.   If you want to grab multiple people from several different items and do sort of a batch processing on them, you could store them into a collection variable (returned from the Query List action without a filter) and process them within a foreach loop.

Which approach do you plan on taking?

-Mike

Userlevel 5
Badge +12

No problem at all.   The community is a great place for these types of questions and you are sure to get a lot of good answers on here.  Just post your questions as needed and I and lots of others will be happy to field them. grin.png

-Mike

Reply