Populate existing SP column


Badge +3

I have a nintex form (on premisses) attached to a SP list. (SP 2013)

I have created an extra SP column that should display information from one off the form fields, this is an existing field.

How can i populatie this SP column with the field value which is on the form for existing form entries.

for new forms thats not a problem as the field is connected to the SP column.


16 replies

Userlevel 5
Badge +14

I believe this is what you need  

Badge +3

Thanks this is what i mean.

I understand the solution in general but building it is something harder.

I have tried some creating a workflow with the folowing steps.

- query the list outputting the listid to a workflow variable SP-listid (type collection)

- then a for each control with a "target collection" the SP-listid and "store result in" a workflow variable WF-listid (Type: listitemID)

-then a query XMl with source XML: {ItemProperty:FormData} and output Xpath with /FormVariables/<var name> and store result in a workflow variable 'WF-cause' (type: single line of text)

- then i have a Log in History list and i am outputting the WF-LIst id an the WF-cause variables. I can see the WF-listid displaying al id nummers but the WF-cause variable is always the same (so not displaying the actual value of the form) but repeating the fist entry. So it's not itterating throug the forms...

So i am doing something wrong. Can somebody put me in the good direction (or even better have an example)

Userlevel 5
Badge +14

if you 'Query XML' from item property you always read field from the item the workflow is running on, regardless of what data you get in loop.

so either:

- create a list workflow and query from item property. then you do not need to query list for all the items nor loop but rather start the workflow on every item that needs to update list field from FormData field

- or create a site workflow with the structure as you described. but along with itemID query as well FormData field to a separate collection and within the loop 'Query XML' from respective element of FormsData collection.

Badge +3

Marion, thanks for helping me.

I am trying the second option so i have added the formsdata as a seperate collection

But i am having trouble to find the exact XML xpath output. Wat is the easiest way to find the code for the field i want to have?

So how can i find the respective element and how does it look like?

Userlevel 5
Badge +14

send FormData XML from one item to yourself by mail notification (plaintext) as an example.

then copy XML over into XPath builder within Query XML action. that should help you to build XPath (it's not 100% reliable but at least can give you good hint).

if you do not manage it to do it that way, post example form data XML here.

Badge +3

i have send it in plain text to me by mail. i got

I need the value off the bold field: eg Business Change

<?xml version="1.0" encoding="utf-8"?><FormVariables><Version /><IssueDescription type="System.String">Regenerated pallet label is a different format to the original </IssueDescription><Database type="System.String">Live Core</Database><NumberOffUsersAffected type="System.Int32">10</NumberOffUsersAffected><IssueCause type="System.String">Business Change</IssueCause><ReportedSupplier type="System.Boolean">True</ReportedSupplier><SupplierName type="System.String">GAC</SupplierName><f5301f3c-c044-44d7-a65a-6d54835a1004 type="System.DateTime">11/01/2016 00:00:00</f5301f3c-c044-44d7-a65a-6d54835a1004><SupplierReference type="System.String"></SupplierReference><CallLog type="System.String">This is not just the label reprint needs to be pointed to a different report as the way it is setup to print labels from a production order is not the same. The format of the reprinted label needs to be changed so that it prints the label for the line selected. This will be a development and will need the change to be documented and added to the development list. This is not an issue but a developemht request.

 

Will be presented to the project board after go live HGS.

 

PN 95 &amp;amp;nbsp;has been raised on GAC site and some development has now been done.</CallLog><c6728554-1766-42eb-9e75-bdc36290b873 type="System.String">Development required - requirements to be defined</c6728554-1766-42eb-9e75-bdc36290b873><Teller type="System.Int32">1</Teller><CreationDate type="System.String">26-01-17</CreationDate><CreatedBy type="System.String">Brown, Michael</CreatedBy><Attachments type="System.String"></Attachments><e42e4f8c-e137-4aa7-b58a-bfd2990ef324 type="System.String"></e42e4f8c-e137-4aa7-b58a-bfd2990ef324></FormVariables>

Userlevel 5
Badge +14

following XPath should work for you

/FormVariables/IssueCause

Badge +3

Hi all this is very helfull so finally (sorry for my lack of knowledge) I now can iterate trought the collection and have the value from the form stored in a workflow variable.

So next step is to update every SP list item with that value.

I have tried the 'update item' component but doet doesn't work. I think its is because it is not the SPlist it iterates but the collection.

In the solution supplied i read:

- parse that XML out for respective control name/guid and its value

- update new list column with that value

So what does this mean in terms of nintex controls?

Erik

Userlevel 5
Badge +14

can you clarify which way you decided to go on? did you create list or site workflow?

can you post how does your workflow looks like and what's the configuration of update item action?

Badge +3

 am working on the site workflow to update all SP items in the list.

attached the WF overview and the update item (which is in error when i try to run it)

workflow overviewupdate item

Userlevel 5
Badge +14

what are datatypes of WF-IssueDescription and WF-IssueCause? are they, or at least one of them collection?

if so it is not going to work. you have to provide scalar values (single collection element).

to get collection element, you can do it directly in for each action for loop driving collection or with collection operation action for other collection(s)

Badge +3

HI Marion thanks for helping me.

In the for each  query the list and have two output variables both collections holding the ID's and one holding the Formdata.

In the for each in through the formdata collection and output it to a variable which is of type "multiple lines of text"

IN the query xml i query the WF-Formdata and output 2 variables WF-issuecause, single line of text and WF-issuedescription mutliple lines of text.

Then the update item as already explained.

So what to change?

Userlevel 5
Badge +14

1. configuration (theoretically) seems to be correct.

however, since you just parsed out value of WF-IssueDescription from FormData and formerly you have said you want to update data that are missing in the list, do you already have populated list field Description with respective value(s), so that update item action could match an item to update?

next, are you sure when looking for an item by Description that at most one item matches the condition?

what error do you get from update item action?

2. how I would do it:

- for each loop: I would store current loop index into a variable (eg. varIdx)

- I would added collection operation action to get item ID from SPListID collection at varIdx position and stored it to a variable (eg. varCurrID)

- update item action: I would change where condition to search for item to update by ID, ie. ID equals varCurrID

Badge +3

1) The listfield descriptions are in the SPlist, so each item should be unique. BUT, i have discoverd that in some cases the description field is displayed on the form and is als in the SPlist but are missing in the XML file. So that means this will not work (i have asked Nintex support why fields are missing from the XML but are diplayed on the form).

2) I dont understand the technical translation to what your are saying and how do i use it in the workflow. 

- How do i store the loopindex (whats a loop index?)

- What is collection operation?

Sorry, i am to stupid

I thought it would be easy to itterate trough a SP list and fill/update a column with a field coming from a form.....

Userlevel 5
Badge +14

in some cases the description field is displayed on the form and is als in the SPlist but are missing in the XML file

in FormData XML there are only values for controls that are not connected to list fields.

if you have Description control on the form and it is connected to Description field in the list then it will not appear in FormData.

it might however happened, that you added/connected form control to list field after you have had already created some items. in that case for some items (old ones) it will appear in FormData, but for the other (newer ones) not.

I thought it would be easy to itterate trough a SP list and fill/update a column with a field coming from a form.....

it's easy, you just maybe need little more practice happy.png

- How do i store the loopindex (whats a loop index?)

- What is collection operation?

Badge +3

Sorry for the late response but i was on holiday and had some technical problems with my test environment.

But nevertheless now it works ok!

Using the index field was a way to go.

Many thanks for your patience!

Regards

Reply