title: How to convert Teams Conversations(HTML) to JSON in Sharepoint
body: <p>I am trying to publish a Teams Channel in Sharepoint. By using Power Automate i use the trigger &quot;When new message is sent&quot;. But since the Lists in Sharepoint can't take HTML i have to convert the messages HTML into text. The problem is that if the message includes hyperlinks or pictures etc, it really looks aweful on Sharepoint.</p>
  <p>Is there a way to get all relevant information from the messeage and display it correctly in the Formatt View in Sharepoint?</p>
  <p>Another problem is that i seem not able to use $CreatedDate in the formatting view. It won't show up.</p>
  <p>This is the JSON code I currently use for the formatting:</p>
  <pre><code>    {
    &quot;schema&quot;: &quot;https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json&quot;,
    &quot;debugMode&quot;: false,
    &quot;hideSelection&quot;: true,
    &quot;hideColumnHeader&quot;: true,
    &quot;rowFormatter&quot;: {
      &quot;elmType&quot;: &quot;div&quot;,
      &quot;attributes&quot;: {
        &quot;class&quot;: &quot;ms-borderColor-neutralLight&quot;
      },
      &quot;style&quot;: {
        &quot;flex-direction&quot;: &quot;row&quot;,
        &quot;align-items&quot;: &quot;stretch&quot;,
        &quot;box-sizing&quot;: &quot;border-box&quot;,
        &quot;border-width&quot;: &quot;1px&quot;,
        &quot;border-left-width&quot;: &quot;4px&quot;,
        &quot;border-style&quot;: &quot;solid&quot;,
        &quot;margin-bottom&quot;: &quot;10px&quot;
      },
      &quot;children&quot;: [
        {
          &quot;elmType&quot;: &quot;div&quot;,
          &quot;style&quot;: {
            &quot;padding&quot;: &quot;10px 10px&quot;
          },
          &quot;children&quot;: [
            {
              &quot;elmType&quot;: &quot;div&quot;,
              &quot;style&quot;: {
                &quot;margin-right&quot;: &quot;10px&quot;
              },
              &quot;children&quot;: [
                {
                  &quot;elmType&quot;: &quot;img&quot;,
                  &quot;attributes&quot;: {
                    &quot;src&quot;: &quot;= @currentWeb + '/_layouts/15/userphoto.aspx?size=L&amp;accountname='+[$From.email]+'&amp;UA=0&amp;size=HR48x48'&quot;,
                    &quot;title&quot;: &quot;[$From.email]&quot;
                  },
                  &quot;style&quot;: {
                    &quot;border&quot;: &quot;1px solid #808080&quot;,
                    &quot;border-radius&quot;: &quot;50%&quot;,
                    &quot;left&quot;: &quot;50%&quot;,
                    &quot;width&quot;: &quot;48px&quot;,
                    &quot;height&quot;: &quot;48px&quot;,
                    &quot;display&quot;: &quot;flex&quot;
                  }
                }
              ]
            }
          ]
        },
        {
          &quot;elmType&quot;: &quot;div&quot;,
          &quot;style&quot;: {
            &quot;box-sizing&quot;: &quot;border-box&quot;,
            &quot;padding&quot;: &quot;0 20px&quot;,
            &quot;border-left&quot;: &quot;3px solid black&quot;
          },
          &quot;children&quot;: [
            {
              &quot;elmType&quot;: &quot;div&quot;,
              &quot;style&quot;: {
                &quot;flex&quot;: &quot; 1 0 300px&quot;
              },
              &quot;children&quot;: [
                {
                  &quot;elmType&quot;: &quot;div&quot;,
                  &quot;style&quot;: {},
                  &quot;children&quot;: [
                    {
                      &quot;elmType&quot;: &quot;div&quot;,
                      &quot;style&quot;: {
                        &quot;display&quot;: &quot;flex&quot;,
                        &quot;flex-direction&quot;: &quot;row&quot;
                      },
                      &quot;children&quot;: [
                        {
                          &quot;elmType&quot;: &quot;div&quot;,
                          &quot;attributes&quot;: {
                            &quot;class&quot;: &quot;ms-font-m&quot;
                          },
                          &quot;style&quot;: {
                            &quot;line-height&quot;: &quot;1.5em&quot;,
                            &quot;margin&quot;: &quot;8px 0&quot;,
                            &quot;font-weight&quot;: &quot;bold&quot;
                          },
                          &quot;txtContent&quot;: &quot;=[$From.title]+', '&quot;,
                          &quot;children&quot;: []
                        },
                        {
                          &quot;elmType&quot;: &quot;div&quot;,
                          &quot;attributes&quot;: {
                            &quot;class&quot;: &quot;ms-font-m&quot;
                          },
                          &quot;style&quot;: {
                            &quot;line-height&quot;: &quot;1.5em&quot;,
                            &quot;margin&quot;: &quot;8px 0&quot;,
                            &quot;font-weight&quot;: &quot;bold&quot;
                          },
                          &quot;txtContent&quot;: &quot;=toLocaleString([$DateCreated])&quot;
                        }
                      ]
                    },
                    {
                      &quot;elmType&quot;: &quot;div&quot;,
                      &quot;attributes&quot;: {
                        &quot;class&quot;: &quot;ms-font-xxl&quot;
                      },
                      &quot;style&quot;: {
                        &quot;line-height&quot;: &quot;1.5em&quot;,
                        &quot;color&quot;: &quot;#0077FF&quot;,
                        &quot;margin&quot;: &quot;8px 0&quot;
                      },
                      &quot;txtContent&quot;: &quot;[$Title]&quot;
                    },
                    {
                      &quot;elmType&quot;: &quot;div&quot;,
                      &quot;attributes&quot;: {
                        &quot;class&quot;: &quot;ms-font-m&quot;
                      },
                      &quot;style&quot;: {
                        &quot;line-height&quot;: &quot;1.5em&quot;,
                        &quot;margin&quot;: &quot;8px 0&quot;
                      },
                      &quot;children&quot;: [
                        {
                          &quot;elmType&quot;: &quot;div&quot;,
                          &quot;style&quot;: {
                            &quot;display&quot;: &quot;inline-block&quot;
                          },
                          &quot;children&quot;: [
                            {
                              &quot;elmType&quot;: &quot;span&quot;,
                              &quot;attributes&quot;: {
                                &quot;class&quot;: &quot;ms-fontWeight-semibold&quot;
                              },
                              &quot;style&quot;: {
                                &quot;margin-right&quot;: &quot;18px&quot;
                              },
                              &quot;txtContent&quot;: &quot;[$Message]&quot;
                            }
                          ]
                        }
                      ]
                    },
                    {
                      &quot;elmType&quot;: &quot;a&quot;,
                      &quot;iconName&quot;: &quot;Mail&quot;,
                      &quot;class&quot;: &quot;sp-field-quickActions&quot;,
                      &quot;href&quot;: &quot;[$DeepLink] + [$ID]&quot;
                    },
                    {
                      &quot;elmType&quot;: &quot;a&quot;,
                      &quot;style&quot;: {
                        &quot;display&quot;: &quot;inline-block&quot;,
                        &quot;padding&quot;: &quot;0 74x&quot;
                      },
                      &quot;class&quot;: &quot;sp-field-quickAction&quot;,
                      &quot;attributes&quot;: {
                        &quot;iconName&quot;: &quot;Mail&quot;,
                        &quot;target&quot;: &quot;_blank&quot;,
                        &quot;href&quot;: &quot;[$DeepLink]&quot;
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
  </code></pre>
  <p>This is the flow seutp I use for trigger and request:
  <a href="https://mattipaukkonen.com/2019/10/04/low-code-solution-for-publishing-teams-conversations-on-sharepoint/" rel="nofollow noreferrer">https://mattipaukkonen.com/2019/10/04/low-code-solution-for-publishing-teams-conversations-on-sharepoint/</a></p>