Forum Discussion

jwf1081's avatar
jwf1081
Copper Contributor
Dec 10, 2021
Solved

SharePoint List button to MS Form

Is it possible to have a button in a SharePoint list column that enables the user to be able to click which will take them to a specific MS Forms URL? 

 

Here is my attempt but I just can't seem to get it to work... 

 

 

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"style": {
"border": "dark",
"background-color": "green",
"color": "white",
"cursor": "pointer",
"align-items": "left",
"height": "40px"
},
"txtContent": "Button",
"attributes": {
"target": "_blank",
"href": "https://forms.office.com/Pages/ResponsePage.aspx?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}

  • jwf1081 To create a button with hyperlink, change your JSON in below format:

     

    {
        "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
        "elmType": "a",
        "attributes": {
            "href": "https://forms.office.com/Pages/ResponsePage.aspx?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "target": "_blank"
        },
        "style": {
            "text-decoration": "none"
        },
        "children": [
            {
                "elmType": "button",
                "txtContent": "Go to Client Data",
                "style": {
                    "cursor": "pointer",
                    "width": "100%"
                }
            }
        ]
    }

     

    Additionally, you can apply other CSS styles as per your requirements. Check my answer given in this thread: Custom view rowformatter - how to make a hyperlink look like a button 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

  • jwf1081 To create a button with hyperlink, change your JSON in below format:

     

    {
        "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
        "elmType": "a",
        "attributes": {
            "href": "https://forms.office.com/Pages/ResponsePage.aspx?id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "target": "_blank"
        },
        "style": {
            "text-decoration": "none"
        },
        "children": [
            {
                "elmType": "button",
                "txtContent": "Go to Client Data",
                "style": {
                    "cursor": "pointer",
                    "width": "100%"
                }
            }
        ]
    }

     

    Additionally, you can apply other CSS styles as per your requirements. Check my answer given in this thread: Custom view rowformatter - how to make a hyperlink look like a button 


    Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Resources