Solved

How to connect a custom task form field to a field in the list?

  • 20 October 2017
  • 23 replies
  • 103 views

Badge +5

I have a task form custom field that I have connected to a list field. It is a user field, which happens to be the next user in the process. But when they fill it out it does not get saved into the sharepoint list. So when I do my lookup for the next user in the process it can't find it and stops. I am new to Nintex. Am I going about this the wrong way?

icon

Best answer by jgabella 25 October 2017, 21:02

View original

23 replies

Badge +4

Hi Joe, it's possible that the connection isn't sticking somehow, depending on the order you used to add the people field to the task form or maybe a bug with it handling people fields. If you can't get it to save into the field properly you might still be able to access the xml of the Nintex form that gets saved in the Form Data on that task item and then use a query xml to get your field value out. I haven't tried it myself but maybe that would work?

Userlevel 6
Badge +12

Hello ‌ - 

Do you already have your person field on the list? If so, you should be able to simply add the list field to your task form rather than trying to connect the form to the list. This makes the user filing out the form write directly to the list rather than to the task form and then to the list.

Badge +5

This does not work either. Very frustrating.

Userlevel 6
Badge +12

Try removing the person field that is on the form under "List Item" and adding in the one from the left side controls (under "List Columns").

Here it is in action:

Create item in list (no changes to the form ootb):

I did not add in a user for [Next User]

This is the Task Form that I created (With classic):

Go back to my list and refresh:

Another task should be assigned to [Next User] (this time with responsive just to be sure it works with each setup) ...

We can see that I am still listed as the [Next User]. Let's change that to good ol' Tester McGee

And again, let's check the list to ensure that the data come through:

Let me know if you have any questions, but try removing the initial control and replace it with the "List Columns" control.

Hope this helps!

Badge +5

Jesse, I removed the one that was imported and added from the list controls and it still does not work. I have a support ticket out for this. And this is on office 365 by the way.

Userlevel 6
Badge +12

Hmmm... Not sure why it wouldn't work for you. Are you updating the task form in the task action within the workflow or the task form on the task list?

‌ / - Any thoughts?

Badge +5

I click on the link in the email.

Userlevel 7
Badge +17

Jessie, your explanation is complete and very descriptive. I rather think this is something on Joe side, maybe some sort of misconfiguration or misunderstanding. 

Joe, so please confirm - you have a task list, to which you have added a new field - Next Person, that is a people picker field. Then you have created a task form using Nintex Forms for Office 365, and you have added that field.

Can you confirm, that the field, in its settings, is having the "Connected To" configuration option showing the name of the people column from your list?

If yes - how and when that field is filled with information? By a current approver, who is responding to a task (he manually indicates who the next approver is) or by the workflow? How do you then use that information?

Does the workflow look up the task, read the information from that field and accordingly assign the task to indicated person?

Regards,

Tomasz

Badge +5

Lets make it simpler, I have a task form, that I put a list control on that has the "connected to" field populated with the field in the list. This field is on the list that the workflow runs on not the task list. When I click on the link in the email it takes me to the task form. I fill out the fields and click submit and the information does get saved on the form, but not in the list. Does that make sense?

Userlevel 7
Badge +17

Yes it does

So no - it will not work. Nintex Forms save information only to those lists, for whose item they were opened. So if you open a form for a task list item, anything you write there will be saved only to the tasks list. You only show data from the other list. But that field won't get updated in that other list.

You can do it in two ways:

  1. After your task gets approved/ rejected you can use the workflow, to update the related item, using the data provided on that task's form;
  2. Create a custom jQuery function, that you will call when user clicks the "Submit" button on the form. The function would call list REST API to update the related item, using the information provided on the form.

Both will work. If you are just beginning your journey with Nintex, I would recommend the first approach

Regards,

Tomasz

Badge +5

So just to confirm, in his example above he created that field in the task list?

Userlevel 7
Badge +17

Exactly

Badge +5

So I would use the "Office 365 update items" action?

Userlevel 7
Badge +17

Not necessarily. First, you should use the setting either on the "Assign a task" or "Start a task process" (don't know which action you are using) to get the ID(s) of the tasks created for you approval.

If you are using the "Start a taks process" even if you are assigning a taks to a single person, in return you will get a collection. So in that case you would need to use the "Get item from collection" operation to retrieve value having index = 0.

Once you have the TaskID that holds the "next approver information", use the "Set field in current item" action (as you workflow is operating on the item you want to update), that is a faster method to change a thing in the current item. The "Office 365" action works slower and is more dedicated for operations you would like to do in other sites, site collections or even tenants.

In the "Set field ..." action choose the people field you want to fill with the information from the task, then by using the "Advanced Lookup" link under the value field, select:

List lookup --> Your tasks list --> field you want to get: "next approver" --> where: ID equals "task ID you obtained from the task action".

Regards,

Tomasz

Userlevel 6
Badge +12

‌ - 

In my example, the [Next User] is a field in my list, not my task list. Keep that in mind. Since we want it to be committed back to the list itself and not the task list, the field has to exist on the list we want to store it in.

Within my workflow, I have a task action and I added the [Next User] list control, to my task form. This allows the user to use the control on the task form and it be committed back to my list.

You can add in some steps within your workflow to extract the data and then add it to the item, but not sure if that complicates it more than needed.

Badge +5

‌ was saying the field has to be in the task list and you are saying it doesn't so now I'm more confused.

Userlevel 7
Badge +17

It seems I was a bit wrong.. Or that my answer was incomplete  Anyway - I have also learnt something new. I talked to Jesse on a side, so in the end what he described is the most straightforward solution, what I - also does the job but requires more work

Regards,

Tomasz

Userlevel 6
Badge +12

‌ - 

Apologies if it is confusing. I attached my .nwp file for the workflow so you can add it and see it in action. My list was simply the [Title] and I added a person column named [Next User]. 

The workflow (attached) has two task actions. Each of the task forms have been modified to have the list [Next User] control on the form. This allows the user to enter in data on the task form and it be committed back to the list.

You can certainly query your task list and pull out any data from the task, but would require a few extra steps.

Feel free to reach out to me directly if you have any questions. I can hop on a call at any time today

Hope this helps!

Badge +5

Ok thanks for your help. It looks like this is a bug then, because I cannot get that to work. I have a support call for 3pm today.

Userlevel 7
Badge +17

If you cannot make it work (for any reason) the solution with using “Update field in current item” will work for 100% J

Badge +5

Yes I figured it might, but it the software is going to allow me to add a list column on a task form, then it should connect to that list item. I'd hate to do the more complicated way every time I want to edit a field on a task form.

Badge +5

Hey guys, the issue was with my "Save" button. "Save" doesn't write back to the list. "Save and Submit" does. Once I changed that on my task form it worked.

Userlevel 7
Badge +17

Good to hear that! Please, mark the most helpful answer as correct then, so that other users can try it if they get into similar problems.

Thanks!

Regards, Tomasz 

Reply