I need help with creating a JSON structure for formatting a custom "single line of text" column in my SharePoint document library. The column, called "Start Document Workflow," should display a button that links to a single PowerAutomate workflow.
I want the button text content to update dynamically according to the values of two other custom columns in the library. The columns are "Workflow Stage" (options are "Draft," "Review," and "Submit), and "Stage Complete?" (options are "Yes" and "No").
The internal name for "Workflow Stage" is "WorkflowStage", and the internal name for "Stage Complete?" is "StageComplete_x003f_".
I would like the button to change dynamically according to the entries for these two columns, as follows:
- "Workflow Stage" = [null] and "Stage Complete?" = [null]: Button displays "Start Draft Workflow"
- "Workflow Stage" = [any entry] and "Stage Complete?" = [null]: No button displays
- "Workflow Stage" = [null] and "Stage Complete?" = [any entry]: No button displays
- "Workflow Stage" = "Draft" and "Stage Complete?" = "No": Button displays "Copy Document"
- "Workflow Stage" = "Draft" and "Stage Complete?" = "Yes": Button displays "Start Review Workflow"
- "Workflow Stage" = "Review" and "Stage Complete?" = "No": Button displays "Copy Document"
- "Workflow Stage" = "Review" and "Stage Complete?" = "Yes": Button displays "Start Submit Workflow"
- "Workflow Stage" = "Draft" and "Stage Complete?" = "No": No button displays; instead, the text "Submit document for approval"
I have very minimal experience with JSON; any suggestions for a working structure that can produce the desired results? Thanks in advance!