Forum Discussion
fred_valaris
Jul 22, 2020Copper Contributor
Trying to create a user forum on a SharePoint Online site
I am trying to create a user forum for employees of my organization to interact within my company's internal news site. However, trying to use the search terms "Sharepoint forum" can be very frustrat...
bbsin
Feb 02, 2021Iron Contributor
This is very interesting. I am looking for something like this.
User to submit question.
Wil you be able to share the JSON for the view.
Thank you
RobElliott
Feb 03, 2021Silver Contributor
bbsin The user submits a question using a form from Microsoft Forms embedded on a page and that form triggers a simple flow in Power Automate:
The suggestion is added to the list and any response is added separately. The view of the list that we display on the page is shown below:
..and the JSON view formatting for that is:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "div",
"_comment_": "MAIN DIV",
"attributes": {
"class": "ms-bgColor-themeLight"
},
"style": {
"display": "flex",
"flex-wrap": "wrap",
"align-items": "stretch",
"flex-direction": "row",
"padding": "20px",
"margin-bottom": "16px",
"max-width": "400px",
"border-radius": "10px",
"background-color": "#660066"
},
"children": [
{
"elmType": "div",
"style": {
"flex-grow": "1",
"display": "flex",
"flex-direction": "column",
"flex-wrap": "nowrap",
"align-items": "left",
"max-width": "400px",
"min-width": "205px"
},
"children": [
{
"elmType": "div",
"style": {
"display": "block",
"font-size": "15px",
"font-weight": "normal"
},
"children": [
{
"elmType": "span",
"txtContent": "=[$Title]",
"style": {
"display": "=if([$Title] == '', 'none', 'block')",
"color": "white"
}
},
{
"elmType": "span",
"txtContent": "[$SubmittedOn]",
"style": {
"display": "=if([$SubmittedOn] == '', 'none', 'block')",
"color": "white"
}
},
{
"elmType": "span",
"txtContent": "='Suggestion: ' + [$Suggestion]",
"style": {
"display": "=if([$Suggestion] == '', 'none', 'block')",
"padding-top": "20px",
"margin": "0 20px 20px 0",
"color": "white"
}
}
]
}
]
},
{
"elmType": "div",
"_comment_": "DIV TWO",
"style": {
"flex-grow": "1",
"display": "flex",
"flex-direction": "column",
"align-items": "left",
"max-width": "310px",
"min-width": "155px"
},
"children": [
{
"elmType": "div",
"style": {
"display": "block",
"font-size": "15px",
"txtContent": "='Comment: ' + [$Comment]",
"font-weight": "normal",
"color": "white"
},
"children": [
{
"elmType": "span",
"txtContent": "='Comment: ' + [$Comment]",
"style": {
"padding-right": "5px",
"display": "=if([$Comment] == '', 'none', 'block')"
}
}
]
},
{
"elmType": "div",
"style": {
"display": "block",
"font-size": "15px",
"font-weight": "normal"
}
}
]
}
]
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User