SharePoint List JSON Format Column Hyperlink

Pieterson, Gene 1 Reputation point
2020-09-16T04:30:54.457+00:00

Hi everyone,

Always appreciate your help here. I formatted my SharePoint list column using JSON to include my PowerApps link. Problem is it will send the general link for my app, but not the link that points to the specific record.

For example,

I want this:

https://apps.powerapps.com/play/7aeac0a1-2799-49ab-8xxc-e3569790xxxx?tenantId=(Blocked For Privacy Reasons)&NTMAppGov=TMOQuest&ID=7

But get this:

https://apps.powerapps.com/play/7aeac0a1-2799-49ab-8xxc-e3569790xxxx?tenantId=(Blocked For Privacy Reasons)

Here's my JSON entry:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"children": [
{
"elmType": "span",
"style": {
"padding-right": "8px"
},
"txtContent": "@currentField"
},
{
"elmType": "a",
"attributes": {
"iconName": "Mail",
"class": "sp-field-quickActions",
"href": {
"operator": "+",
"operands": [
"mailto:",
"@currentField",
"?subject=Request To Complete Questionnaire&body=The app governance team has requested to fill out this questionnaire.\r\n---\r\n",
"\r\nClick this link for more info. 'https://apps.powerapps.com/play/7aeac0a1-2799-49ab-8xxc-e3569790xx?tenantId=(Blocked For Privacy Reasons)&NTMAppGov=TMOQuest&ID='+[$ID]"
]
}
}
}
]
}

How can I fix this?

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,064 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Emily Du-MSFT 24,561 Reputation points Microsoft Employee
    2020-09-16T09:31:57.873+00:00

    @Pieterson, Gene
    Please refer this article to know how to open Power Apps by using SharePoint column JSON formatting.

    For better assistance, you could ask questions about flow in this forum.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments

  2. Christopher Parker 1 Reputation point
    2021-03-16T04:50:48.713+00:00

    I believe the "&" symbol is causing your problem. I usually use URL encoding (percent encoding) when building URLs in JSON. Replacing the & with %26 should resolve your problem. W3C should have all of the encoded characters for reference. Hope this helps.

    No comments

  3. Ganesh Sanap 1 Reputation point
    2022-09-03T12:21:19.73+00:00

    SharePoint JSON formatting now supports replace and replaceAll operators which will help you to replace & with %26.

    For example (using replaceAll operator):

    {
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
    "elmType": "div",
    "txtContent": "=replaceAll([$Title], '&', '%26')",
    "style": {
    "font-weight": "bold"
    }
    }

    References:

    1. SharePoint: Replace All Occurrences of Substring in a String using JSON Formatting
    2. JSON formatting syntax reference
    No comments