|
| 1 | +# Office 365 Page transformation Functions and Selectors |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +The default page transformation configuration (webpartmapping.xml) uses built-in functions and selectors to drive the mapping from classic web parts to modern 1st party and 3rd party web parts. This page lists all the available functions. |
| 6 | + |
| 7 | +> Note: |
| 8 | +> This page is auto-generated, if you see issues please create a PR against the respective Transformation framework code base. |
| 9 | +
|
| 10 | +## Functions |
| 11 | + |
| 12 | +### HtmlEncode |
| 13 | + |
| 14 | +**Description:** Returns the html encoded value of this string. |
| 15 | +**Example:** `{EncodedText} = HtmlEncode({Text})` |
| 16 | + |
| 17 | +#### Input parameters |
| 18 | + |
| 19 | +Name|Description |
| 20 | +:-----|:---------- |
| 21 | +{Text}|Text to html encode |
| 22 | +#### Output parameters |
| 23 | + |
| 24 | +Name|Description |
| 25 | +:-----|:---------- |
| 26 | +{EncodedText}|Html encoded text |
| 27 | +### HtmlEncodeForJson |
| 28 | + |
| 29 | +**Description:** Returns the json html encoded value of this string. |
| 30 | +**Example:** `{JsonEncodedText} = HtmlEncodeForJson({Text})` |
| 31 | + |
| 32 | +#### Input parameters |
| 33 | + |
| 34 | +Name|Description |
| 35 | +:-----|:---------- |
| 36 | +{Text}|Text to html encode for inclusion in json |
| 37 | +#### Output parameters |
| 38 | + |
| 39 | +Name|Description |
| 40 | +:-----|:---------- |
| 41 | +{JsonEncodedText}|Html encoded text for inclusion in json file |
| 42 | +### ReturnTrue |
| 43 | + |
| 44 | +**Description:** Simply returns the string true. |
| 45 | +**Example:** `{UsePlaceHolders} = ReturnTrue()` |
| 46 | + |
| 47 | +#### Output parameters |
| 48 | + |
| 49 | +Name|Description |
| 50 | +:-----|:---------- |
| 51 | +{UsePlaceHolders}|Value true |
| 52 | +### ReturnFalse |
| 53 | + |
| 54 | +**Description:** Simply returns the string false. |
| 55 | +**Example:** `{UsePlaceHolders} = ReturnFalse()` |
| 56 | + |
| 57 | +#### Output parameters |
| 58 | + |
| 59 | +Name|Description |
| 60 | +:-----|:---------- |
| 61 | +{UsePlaceHolders}|Value false |
| 62 | +### ReturnServerRelativePath |
| 63 | + |
| 64 | +**Description:** Transforms the incoming path into a server relative path. |
| 65 | +**Example:** `{ServerRelativePath} = ReturnServerRelativePath({Path})` |
| 66 | + |
| 67 | +#### Input parameters |
| 68 | + |
| 69 | +Name|Description |
| 70 | +:-----|:---------- |
| 71 | +{Path}|Path to transform |
| 72 | +#### Output parameters |
| 73 | + |
| 74 | +Name|Description |
| 75 | +:-----|:---------- |
| 76 | +{ServerRelativePath}|Server relative path |
| 77 | +### ReturnFileName |
| 78 | + |
| 79 | +**Description:** Returns the filename of the given path. |
| 80 | +**Example:** `{FileName} = ReturnFileName({Path})` |
| 81 | + |
| 82 | +#### Input parameters |
| 83 | + |
| 84 | +Name|Description |
| 85 | +:-----|:---------- |
| 86 | +{Path}|Path to analyze |
| 87 | +#### Output parameters |
| 88 | + |
| 89 | +Name|Description |
| 90 | +:-----|:---------- |
| 91 | +{FileName}|File name with extension from the given path |
| 92 | +### Concatenate |
| 93 | + |
| 94 | +**Description:** Concatenates 2 strings. |
| 95 | +**Example:** `{CompleteString} = Concatenate({String1},{String2})` |
| 96 | + |
| 97 | +#### Input parameters |
| 98 | + |
| 99 | +Name|Description |
| 100 | +:-----|:---------- |
| 101 | +{String1}|First string |
| 102 | +{String2}|Second string |
| 103 | +#### Output parameters |
| 104 | + |
| 105 | +Name|Description |
| 106 | +:-----|:---------- |
| 107 | +{CompleteString}|Concatenation of the passed strings |
| 108 | +### TextCleanup |
| 109 | + |
| 110 | +**Description:** Rewrites wiki page html to be compliant with the html supported by the client side text part. |
| 111 | +**Example:** `{CleanedText} = TextCleanup({Text},{UsePlaceHolders})` |
| 112 | + |
| 113 | +#### Input parameters |
| 114 | + |
| 115 | +Name|Description |
| 116 | +:-----|:---------- |
| 117 | +{Text}|Original wiki html content |
| 118 | +{UsePlaceHolders}|Parameter indicating if placeholders must be included for unsupported img/iframe elements inside wiki html |
| 119 | +#### Output parameters |
| 120 | + |
| 121 | +Name|Description |
| 122 | +:-----|:---------- |
| 123 | +{CleanedText}|Html compliant with client side text part |
| 124 | +### TextCleanUpSummaryLinks |
| 125 | + |
| 126 | +**Description:** Rewrites summarylinks web part html to be compliant with the html supported by the client side text part. |
| 127 | +**Example:** `{CleanedText} = TextCleanUpSummaryLinks({Text})` |
| 128 | + |
| 129 | +#### Input parameters |
| 130 | + |
| 131 | +Name|Description |
| 132 | +:-----|:---------- |
| 133 | +{Text}|Original wiki html content |
| 134 | +#### Output parameters |
| 135 | + |
| 136 | +Name|Description |
| 137 | +:-----|:---------- |
| 138 | +{CleanedText}|Html compliant with client side text part |
| 139 | +### ListAddServerRelativeUrl |
| 140 | + |
| 141 | +**Description:** Returns the server relative url of a list. |
| 142 | +**Example:** `{ListServerRelativeUrl} = ListAddServerRelativeUrl({ListId})` |
| 143 | + |
| 144 | +#### Input parameters |
| 145 | + |
| 146 | +Name|Description |
| 147 | +:-----|:---------- |
| 148 | +{ListId}|Guid of the list to use |
| 149 | +#### Output parameters |
| 150 | + |
| 151 | +Name|Description |
| 152 | +:-----|:---------- |
| 153 | +{ListServerRelativeUrl}|Server relative url of the list |
| 154 | +### ListAddWebRelativeUrl |
| 155 | + |
| 156 | +**Description:** Returns the web relative url of a list. |
| 157 | +**Example:** `{ListWebRelativeUrl} = ListAddWebRelativeUrl({ListId})` |
| 158 | + |
| 159 | +#### Input parameters |
| 160 | + |
| 161 | +Name|Description |
| 162 | +:-----|:---------- |
| 163 | +{ListId}|Guid of the list to use |
| 164 | +#### Output parameters |
| 165 | + |
| 166 | +Name|Description |
| 167 | +:-----|:---------- |
| 168 | +{ListWebRelativeUrl}|Web relative url of the list |
| 169 | +### ListDetectUsedView |
| 170 | + |
| 171 | +**Description:** Detects the list view id that was used by the webpart by mapping the web part xmldefinition to the list views. If no view found the list default view id is returned. |
| 172 | +**Example:** `{ListViewId} = ListDetectUsedView({ListId},{XmlDefinition})` |
| 173 | + |
| 174 | +#### Input parameters |
| 175 | + |
| 176 | +Name|Description |
| 177 | +:-----|:---------- |
| 178 | +{ListId}|Guid of the list to analyze |
| 179 | +{XmlDefinition}|XmlDefinition attribute of the XSLTListViewWebPart |
| 180 | +#### Output parameters |
| 181 | + |
| 182 | +Name|Description |
| 183 | +:-----|:---------- |
| 184 | +{ListViewId}|Id of the view to be used |
| 185 | +### ImageLookup |
| 186 | + |
| 187 | +**Description:** Does lookup a file based on the given server relative path and return needed properties of the file. Returns null if file was not found. |
| 188 | +**Example:** `ImageLookup({ServerRelativeFileName})` |
| 189 | + |
| 190 | +#### Input parameters |
| 191 | + |
| 192 | +Name|Description |
| 193 | +:-----|:---------- |
| 194 | +{ServerRelativeFileName}|Server relative file name of the image |
| 195 | +#### Output parameters |
| 196 | + |
| 197 | +Name|Description |
| 198 | +:-----|:---------- |
| 199 | +{ImageListId}|Id of the list holding the file |
| 200 | +{ImageUniqueId}|UniqueId of the file |
| 201 | +### ExtractWebpartProperties |
| 202 | + |
| 203 | +**Description:** Extracts the client side web part properties so they can be reused. |
| 204 | +**Example:** `{JsonProperties} = ExtractWebpartProperties({ClientSideWebPartData})` |
| 205 | + |
| 206 | +#### Input parameters |
| 207 | + |
| 208 | +Name|Description |
| 209 | +:-----|:---------- |
| 210 | +{ClientSideWebPartData}|Web part data defining the client side web part configuration |
| 211 | +#### Output parameters |
| 212 | + |
| 213 | +Name|Description |
| 214 | +:-----|:---------- |
| 215 | +{JsonProperties}|Json properties to configure the client side web part |
| 216 | +### DocumentEmbedLookup |
| 217 | + |
| 218 | +**Description:** Does lookup a file based on the given server relative path and return needed properties of the file. Returns null if file was not found. |
| 219 | +**Example:** `DocumentEmbedLookup({ServerRelativeFileName})` |
| 220 | + |
| 221 | +#### Input parameters |
| 222 | + |
| 223 | +Name|Description |
| 224 | +:-----|:---------- |
| 225 | +{ServerRelativeFileName}|Server relative file name |
| 226 | +#### Output parameters |
| 227 | + |
| 228 | +Name|Description |
| 229 | +:-----|:---------- |
| 230 | +{DocumentListId}|Id of the list holding the file |
| 231 | +{DocumentUniqueId}|UniqueId of the file |
| 232 | +{DocumentAuthor}|User principal name of the document author |
| 233 | +{DocumentAuthorName}|Name of the file author |
| 234 | +### ContentByQueryToHighlightedContentProperties |
| 235 | + |
| 236 | +**Description:** Maps content by query web part data into a properties collection for the contentrollup (= Highlighted Content) web part |
| 237 | +**Example:** `{JsonProperties} = ContentByQueryToHighlightedContentProperties({WebUrl},{ListGuid},{ListName},{ServerTemplate},{ContentTypeBeginsWithId},{FilterField1},{Filter1ChainingOperator},{FilterDisplayValue1},{FilterOperator1},{FilterField2},{Filter2ChainingOperator},{FilterDisplayValue2},{FilterOperator2},{FilterField3},{FilterDisplayValue3},{FilterOperator3},{SortBy},{SortByDirection},{GroupBy},{GroupByDirection},{ItemLimit},{DisplayColumns},{DataMappings})` |
| 238 | + |
| 239 | +#### Input parameters |
| 240 | + |
| 241 | +Name|Description |
| 242 | +:-----|:---------- |
| 243 | +{WebUrl}| |
| 244 | +{ListGuid}| |
| 245 | +{ListName}| |
| 246 | +{ServerTemplate}| |
| 247 | +{ContentTypeBeginsWithId}| |
| 248 | +{FilterField1}| |
| 249 | +{Filter1ChainingOperator}| |
| 250 | +{FilterField1Value}| |
| 251 | +{FilterOperator1}| |
| 252 | +{FilterField2}| |
| 253 | +{Filter2ChainingOperator}| |
| 254 | +{FilterField2Value}| |
| 255 | +{FilterOperator2}| |
| 256 | +{FilterField3}| |
| 257 | +{FilterField3Value}| |
| 258 | +{FilterOperator3}| |
| 259 | +{SortBy}| |
| 260 | +{SortByDirection}| |
| 261 | +{GroupBy}| |
| 262 | +{GroupByDirection}| |
| 263 | +{ItemLimit}| |
| 264 | +{DisplayColumns}| |
| 265 | +{DataMappings}| |
| 266 | +#### Output parameters |
| 267 | + |
| 268 | +Name|Description |
| 269 | +:-----|:---------- |
| 270 | +{JsonProperties}|Properties collection for the contentrollup (= Highlighted Content) web part |
| 271 | +## Selectors |
| 272 | +### TextSelector |
| 273 | + |
| 274 | +**Description:** Allows for option to include a spacer for empty text wiki text parts. |
| 275 | +**Example:** `TextSelector({CleanedText})` |
| 276 | + |
| 277 | +#### Input parameters |
| 278 | + |
| 279 | +Name|Description |
| 280 | +:-----|:---------- |
| 281 | +{CleanedText}|Client side text part compliant html (cleaned via TextCleanup function) |
| 282 | +#### Output values |
| 283 | + |
| 284 | +Name|Description |
| 285 | +:-----|:---------- |
| 286 | +Text|Will be output if the provided wiki text was not considered empty |
| 287 | +Spacer|Will be output if the provided wiki text was considered empty |
| 288 | +### ListSelectorListLibrary |
| 289 | + |
| 290 | +**Description:** Analyzes a list and returns the list base type. |
| 291 | +**Example:** `ListSelectorListLibrary({ListId})` |
| 292 | + |
| 293 | +#### Input parameters |
| 294 | + |
| 295 | +Name|Description |
| 296 | +:-----|:---------- |
| 297 | +{ListId}|Guid of the list to use |
| 298 | +#### Output values |
| 299 | + |
| 300 | +Name|Description |
| 301 | +:-----|:---------- |
| 302 | +Library|The list is a document library |
| 303 | +List|The list is a document list |
| 304 | +Issue|The list is an issue list |
| 305 | +DiscussionBoard|The list is a discussion board |
| 306 | +Survey|The list is a survey |
| 307 | +Undefined|The list base type is undefined |
| 308 | +### ContentEmbedSelectorSourceType |
| 309 | + |
| 310 | +**Description:** Analyzes sourcetype and return recommended mapping. |
| 311 | +**Example:** `ContentEmbedSelectorSourceType({SourceType})` |
| 312 | + |
| 313 | +#### Input parameters |
| 314 | + |
| 315 | +Name|Description |
| 316 | +:-----|:---------- |
| 317 | +{SourceType}|Sourcetype of the viewed page in pageviewerwebpart |
| 318 | +#### Output values |
| 319 | + |
| 320 | +Name|Description |
| 321 | +:-----|:---------- |
| 322 | +WebPage|The embedded content is a page |
| 323 | +ServerFolderOrFile|The embedded content points to a server folder or file |
| 324 | +### ContentEmbedSelectorContentLink |
| 325 | + |
| 326 | +**Description:** If ContentLink is set (content editor) then return Link, otherwise return Content. |
| 327 | +**Example:** `ContentEmbedSelectorContentLink({ContentLink})` |
| 328 | + |
| 329 | +#### Input parameters |
| 330 | + |
| 331 | +Name|Description |
| 332 | +:-----|:---------- |
| 333 | +{ContentLink}|Link value if set |
| 334 | +#### Output values |
| 335 | + |
| 336 | +Name|Description |
| 337 | +:-----|:---------- |
| 338 | +Link|If the link was not empty |
| 339 | +Content|If no link was specified |
0 commit comments