cancel
Showing results for 
Search instead for 
Did you mean: 
m_k
Nintex Newbie

How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

Hello,

I've been assigned to work on the following Nintex workflow and I'm really hoping you guys can help:

  • List in question that requires to be Queried is an imported spreadsheet into a new SharePoint List on Site A
  • A new site workflow on Site B created with variables to be completed by the user (all required and exist in the imported list as columns in Site A)

  • The idea is: Once a request has been submitted. Query the list's specific items in Site A and check if:
  1. User exists but has a disabled account? Then IT gets a task to update item to enabled
  2. User exists and has an enabled account? Just a notification stating the case
  3. User is new? Add information entered in these fields to the list in Site A.

Sorry for the long post and thanks for any help!

I've attached the workflow as of now - It's a mess (sorry). I've been trying different scenarios and none of them seem to work.

But it should serve as a good reference to what I would like to achieve exactly.

Labels: (1)
0 Kudos
Reply
12 Replies
cassymfreeman
Automation Master
Automation Master

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

I am unable to look at your workflow but here is how I would approach it.

  • Query the list and find item where user exists.  Return ID and status of the employee (ie enabled/disabled) in the query into an ID variable and text variable with no default values.  Let's call them vIDUser and vTextStatus.
  • Set a condition action to check if vIDUser is blank.
    • If it is then you know it is a new user entirely.  Then you can add the item to Site A.
    • If it is not, then you know the user exists, so have another set a condition to check the status = enabled.  If it is, then email that user exists.  If not, then set task to update item.
Reply
m_k
Nintex Newbie

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

Hi Cassy,

Thank you so much for responding!

This might be a silly question, but how do I find item where user exists in a QL? If it is by adding a filter, the issue for me is that I don't really have one item as a unique identifier. As you can see in the screen shots, there are: Given Name and Family Name fields which would be my first go-to. Do I then add 2 filters in the QL?

0 Kudos
Reply
cassymfreeman
Automation Master
Automation Master

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

Yes you can add multiple filters to suit your needs. How many users will be inputting data on that form? I think it will be hard to find a match on those fields as no two users will enter the data the same. The email address should be unique to a user but I can't work out if that is the email address to be created or not?

0 Kudos
Reply
m_k
Nintex Newbie

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

Yes! Actually the Primary Email field was my other go-to. It would probably be the only other 1 unique identifier at this point.

In this particular scenario (check if user exists and is enabled), the email already exists in the list.

Would that be the ID variable then?

0 Kudos
Reply
cassymfreeman
Automation Master
Automation Master

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

Yeah I would say that's the best one to match on. Return the list item "ID" field and whatever field you capture if the user is enabled or disabled. Then you can do your checks with that data as per my previous response.

0 Kudos
Reply
m_k
Nintex Newbie

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

Okay, so I ran the workflow for a test but it seemed to have errored at the QL stage with this message: "Failed to query list data. Cannot find a field with internal name 'mariam.kabesh@ssi-corporate.com' on list."

This email address is on the list though - It's mine actually and I added it for testing purposes.

This is how my QL Action looks like at the moment with vID = List Item ID and and TextStatus = Single line of text.

0 Kudos
Reply
cassymfreeman
Automation Master
Automation Master

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

Your variables are right but the fields they are being assigned to are wrong. You need to type "ID" in the field text box and click add, then do it again with "account status". You can try run now at the top to check the query but you will have to replace item property : primary email with the email address you typed above.

0 Kudos
Reply
cassymfreeman
Automation Master
Automation Master

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

These are the names of the fields from site A you want to pull back.

0 Kudos
Reply
m_k
Nintex Newbie

Re: How can I query a sharepoint list on a different site from a site workflow?

Jump to solution

Sorry to bug you! I've been getting the same error but on the Account Status portion :\

Just to make sure I understand correctly: I should type in "Account Status" in the field box and assign it to TextStatus variable, yes? (So sorry!)

0 Kudos
Reply