Skip to main content

Hi All

Need help with pulling back data from a SPO list to a task form.

I have a workflow that checks a SPO list and anything that is older than 3 days from a date column is then sent a task from to the email address associated to that item.

I then send a task from to that user and I want to pre populate that task from with the current data in the list for that specific item.

The problem I have is it will only allow me to select the current item data as per below.  Does anyone know how I get round this please?

Thanks

Hi @Andy.Emery 

Here are the steps to loop through the result of the Query List.

  1. Step 1 → Query a List. Specify the output for the result eg “SPO Query”
  2. Step 2 → Loop for Each. Specify “SPO Query → Items” as the input (Target Collection)
  3. Step 3 → The current value of the items can be selected from the “Loop for Each → Current”

 

The image below should illustrate the steps 

 

SPO List

 

Workflow Log 

 


I dont get the loop for each option.  I query the list outside of the loop because I then have branch by condition of choosing the items with a particular date.  I then assign the task but that is a problem as it stops the workflow until that first item has been completed which wont work for what I want to do.  So I dont think this will work for my intended purpose


Hi @Andy.Emery 

You will be able to get the value of the Current Item anywhere inside the Loop for Each action eg Log, Task Form etc

 


No it only shows the option for Queried list>First item as in my first image at the top as that action is inside the loop.  The only way I could see how I get round it was to create variable and as the variable to the form field.

 

But even then the workflow will pause when it has assigned the task tot he first item that meets the condition until that has been completed but that does not meet the requirements of the use of the workflow so not sure how I can get round it


Hi @Andy.Emery 

I believe that you are selecting from the SharePoint Online category.

Try to select from the Loop for Each category. Then you will see the Current Item object

 

 


I dont get a loop for each option within the task from fields when trying to add a value. see below

 


I do get the loop for each option for log instance details 


Hi @Andy.Emery 

You are right. The “Loop for Each → Current Item” is not available or selectable from the Task Form.

Gimme 15 minutes to show you another way of accomplishing this

 


I have started now to create a component workflow to be called and then assign the task there? is that the best way?


Hi @Andy.Emery 

 

Make the following changes.

  1. Query List → no changes
  2. In the Loop for Each. Specify “SPO Query → Item ID(s)” as the input (Target Collection)
    This will just return the Item ID and not the full row details.
  3. In order to retrieve the row detail, use a “Retrieve an Item” action. Input is “Current Item”.
    Remember to set the Output variable name e.g. “SPO Retrieve Item
  4. Now you should be able to use the value directly instead of saving it to a variable first.
    SPO Retrieve Item → <field name>”

 

 

Workflow

 


I have started now to create a component workflow to be called and then assign the task there? is that the best way?

That’s really not necessary  

 

Using “Loop For Each with Item IDs” and “Retrieve an Item” should solve your issues. 


So just made the changes, and while its now much easier to put the form variables in the task form it still waits for the first item to complete the task before it moves tot he next item :(


aha! Now I see the reason for placing the Assign Task into a Component Workflow as it needs to run concurrently. You seem to know your scenario better

 

The Primary Workflow will just query the list searching for rows which meets a specific condition (Last Updated is more that 3 days)

When row matches the condition, Primary workflow will call a Component Workflow passing the Item ID as one of the parameters.

The Primary Workflow ends once all the rows has been processed.

 

Component Workflow will retrieve the row details (using the Item ID) and perform the Assign Task. It will update back the row with newer data from the Task Assign form using the Update Items action. Remember to set the condition for the Update Items → ID equals an integer <item ID>. otherwise the entire list get updated.


yep thats the one, so there really is no other way to do it within the one workflow?

Thanks for the info regarding the integer, I will keep that in mind when i get tot hat part

thanks for all your help


You’re welcome
Hope you can complete your workflow successfully

 

Cheers,
Garrett


Reply