Home > Forum > Data sources > Start Workflow using Sharepoint Library

Start Workflow using Sharepoint Library
0

Hi all,


I'm taking some time to explore the possibilities of Sharepoint and Webcon. I have a process set up to approve internal documents and they need to be renewed after 1 year from the previous date.

I was trying to set up the beginning of the process in the Library List (and in the future use the renewal date do display the Start Workflow option for the line) and took the example of
https://community.webcon.com/posts/post/starting-workflow-from-the-sharepoint-document-library/54


I've did all the same configurations as the document to try to get it working but my Start BPS column is not displayed. The json code that is in the post needs to be formatted and my final version (for my case) is:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent": "=if ([$Status] == '' 'Start WEBCON BPS!', if ([$Status] == 'In progress', '', ''))",
"attributes": {
"target": "_blank",
"href": " = 'https: //vision-box.webconapps.com/db/1/app/41/start/wf/93/dt/86/form?com_id=1&returnurl=%2Fdb%2F1%2Fapp%2F41%2F&AttText1=' + [$FileLeafRef] + '&AttText2=' + [$ID] + '&AttText3='+[$FileRef]"
}
}


Using the example, as my Status column is empty, the Start should be displayed.

Does anyone have something like this working on your Webcon Apps?


Thank you!

MVP

Hi Andreia,

I tested your code, and probably there is a missing comma in if statement.
Here is example code which is working for me:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "a",
"txtContent":"=if ([$Status] == '', 'Start WEBCON BPS!', if ([$Status] == 'In progress', '', ''))",
"attributes": {
"target": "_blank",
"href": "https://community.webcon.com/"
}
}

Also, you can check Microsoft Docs for some information about column formatting - https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting