Last active
January 17, 2021 16:23
-
-
Save expiscornovus/138b02816b8130c52eeba69f903a9ed1 to your computer and use it in GitHub Desktop.
SharePoint Online REST API add CreateFieldAsXml CustomFormatter sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"parameters": | |
{"__metadata": | |
{"type":"SP.XmlSchemaFieldCreationInformation"}, | |
"SchemaXml":"<Field CustomFormatter='{"elmType":"div","style":{"flex-wrap":"wrap","display":"flex"},"children":[{"elmType":"div","style":{"box-sizing":"border-box","padding":"4px 8px 5px 8px","display":"flex","border-radius":"16px","height":"24px","align-items":"center","white-space":"nowrap","overflow":"hidden","margin":"4px 4px 4px 4px"},"attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceOne')}"]},"@{variables('ChoiceColorOne')}",{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceTwo')}"]},"@{variables('ChoiceColorTwo')}",{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceThree')}"]},"@{variables('ChoiceColorThree')}",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"","sp-field-borderAllRegular sp-field-borderAllSolid sp-css-borderColor-neutralSecondary"]}]}]}]}},"children":[{"elmType":"span","style":{"line-height":"16px","height":"14px"},"attributes":{"iconName":{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceOne')}"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceTwo')}"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceThree')}"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"",""]}]}]}]}}},{"elmType":"span","style":{"overflow":"hidden","text-overflow":"ellipsis","padding":"0 3px"},"txtContent":"@currentField","attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceOne')}"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceTwo')}"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField","@{variables('ChoiceThree')}"]},"",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"",""]}]}]}]}}}]}],"templateId":"BgColorChoicePill"}' DisplayName='@{variables('ChoiceColumnName')}' FillInChoice='FALSE' Format='Dropdown' IsModern='TRUE' Name='@{variables('ChoiceColumnName')}' Title='@{variables('ChoiceColumnName')}' Type='Choice'><CHOICES><CHOICE>@{variables('ChoiceOne')}</CHOICE><CHOICE>@{variables('ChoiceTwo')}</CHOICE><CHOICE>@{variables('ChoiceThree')}</CHOICE></CHOICES></Field>", | |
"Options":12 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment