Question

How to set the Workflow Status column value via powershell/Nintex WF

  • 3 January 2023
  • 0 replies
  • 103 views

Badge

hi 

We have a list on which a workflow  named “Approve Items” has already run. For some of the items in this list, the column “Approve items” is blank though the WF has run. I can even see the workflow history and the WF is there along with rest of details.  Its just that link which takes the user from List View to the Workflow history which is blank.

I want to somehow updated this column ( Approve items) on these selected items with the link . Already tried this PS script but it does not seem to make any change to the column.  

Any idea on how to achieve this?  

Also, it seem the column added by WF is of the type WorkFlowStatus and not really a hyperlink column.

---------------------------------PS-----------------------------

Add-PSSnapin Microsoft.SharePoint.Powershell 

$webUrl = "https://WEBURL"
$nintexWFlist = "NintexWorkflowHistory"
$cntrListName = "Main List on Which WF is Running"

$web = get-spweb $webUrl
$cntrList = $web.Lists[$cntrListName]
$ListItem = $cntrList.Items | Where {$_["ID"] -eq 26473}

$ListItem > d:\scripts\26473.txt

$ofldurl= new-object Microsoft.SharePoint.SPFieldUrlValue($ListItem["Approve Items"])


#$ofldurl.URL = "WEB-URL/_layouts/15/NintexWorkflow/WorkflowLog.aspx?ListId=ef7f675a-cff2-495e-a260-b7e651b7b5ba&ItemId=20679&WorkflowId=308d9bad-108e-4acd-94a2-ea3e497a239f&InstanceId=31de7c30-ee4f-41fc-88f4-0a040fedb35f"


#$ofldurl.Description = "Completed"


$ListItem.update()

 

 


0 replies

Be the first to reply!

Reply