Solved

Query item within a form from an external list


Userlevel 1
Badge +9

Hello,

Is it possible to query something that sits in an external list from within a nintex forms for O365? Then populate that to a text field?

 

If so, what steps do you take to approach this?

 

Thanks in advance!

icon

Best answer by bamaeric 13 July 2023, 19:34

View original

10 replies

Userlevel 5
Badge +13

Can you please provide some more details on what you mean by an “external list”.

Userlevel 1
Badge +9

@bamaeric ,

Sorry for the delay, been OOO… Anyhow, what I want to do is populate my current list with lookup info that lies in an external list. Is that possible to do within a form? Or does this need to be handled in a workflow (query)? I tried querying in a workflow that is used in my current list to lookup in the external list but when I see the log history, my output is []… not sure I’m approaching this correctly.

Thanks in advance!!!

Userlevel 5
Badge +13

Hi @jpacheco,

You can definitely lookup data from another list and populate a List Lookup control on a form. I am assuming you are using the New Responsive designer for my response.

You can add and configure the List Lookup control to a form. In the control settings, you can select the SharePoint site URL (which can be a completely different site) and then select the list that has the data you want to use in the List Lookup dropdown control.

You can next use the “Connected to” setting to select the list column that you want to save the lookup data in.  Alternatively, you could populate a text field on the form with the data selected in the lookup control using a combination of rules and form variables.

Here is a link the Help topic for configuring the form List Lookup control: List Lookup (nintex.com)

Userlevel 1
Badge +9

@bamaeric,

Awesome and thanks for this info! 👍 And yes, I am using Nintex Forms and Workflows for O365 (new responsive designer).

Now, if I wanted to utilize the “Query List” option within a workflow, would you be able to tell me how I would go about getting an email address to populate within a variable?

I currently have this setup (below) to “Lookup” the external list called “_SetofBooks” and pull the email address if the “Unique Approval?” is selected. Then grab the email address, apply it to the variable “approver” but continue to receive “[]”…

 

 

 

External SharePoint List

 

Userlevel 5
Badge +13

Just confirming. Is the Approver Email a Person/Group type field? Is it set to “Allow multiple selections”?

Userlevel 1
Badge +9

@bamaeric ,

It is text (firstname.lastname@mail.com) entered in a text field… I also tried using a people picker control but continue to get the “[]” in my log history…

 

Thanks in advance!

Userlevel 5
Badge +13

When you use the Query List action, the results are stored in a workflow collection variable. So the Output “approver” variable is actually a collection variable. That is why you results include the [ ] characters.

You will need to add a “Get Item From Collection” action after the Query List action to retrieve the Approver Email and store it in a workflow variable. You can configure the “Get Item From Collection” action with these settings:

  • Target collection = approver
  • Index Equals value 0   (this is the first item in the collection variable)
  • Output = txtEmail  (this is a text variable that you create and name)

You can then use the txtEmail variable in your workflow.

 

Userlevel 1
Badge +9

@bamaeric ,

I was so stoked to attempt this and then I got the following… I have it set to following in the second screen shot.

 

 

 

Userlevel 5
Badge +13

That seems to indicate that no items are being returned from the Query List action. I would suggest creating a variable for the Result Count setting in the Query List action.  Then use a “Log in history list” action to include that variable to tell you how many items are being returned from the Query list action.  If that comes back as 0, then you might need to adjust the query.

Badge +1

so I have a cascading dropdown field, which is fed from another dropdown and another list.  I have configured that dropdown to return only unique values and I know from my other list that this will only ever return ONE value, which is text.

Can i write that value to a text field without that value ever being selected in the final lookup dropdown field?
List B has 2 columns
Colum A and B, column A has 3 choices (say Site1, Site 2 and Site 3) and column B (has only 1 option entered for each entry in column A (which will be 1, 2 or 3)
In the form I have 2 lookup fields, with the 2nd cascading from the first and both linked to list B.

lookupfield 1 - allows a user to select Site1, site 2 or Site 3
lookupfield 2 is linked to the result of Lookupfield 1 and will display unique values from column B in list B.

But ideally I do not want a user to have to select the value available for lookupfield 2, As I know it will always be a single text value I would like to simply write that choice (without the user having to select it and populate lookupfield 2) to a text field.

Is this possible, if so how on earth would I do this?

 

Reply