Skip to content

Commit 624941f

Browse files
committed
UX clarity edits
1 parent cb56b5f commit 624941f

File tree

3 files changed

+84
-20
lines changed

3 files changed

+84
-20
lines changed

articles/logic-apps/logic-apps-perform-data-operations.md

Lines changed: 84 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -159,37 +159,69 @@ If you prefer working in the code view editor, you can copy the example **Create
159159

160160
![Select array output for creating CSV table](./media/logic-apps-perform-data-operations/configure-create-csv-table-action.png)
161161

162+
> [!TIP]
163+
> To create user-friendly tokens for the properties in JSON objects so you can select
164+
> those properties as inputs, use the [Parse JSON](#parse-json-action) before calling
165+
> the **Create CSV table** action.
166+
162167
Here is the finished example **Create CSV table** action:
163168

164169
![Finished "Create CSV table" action](./media/logic-apps-perform-data-operations/finished-create-csv-table-action.png)
165170

166171
1. Save your logic app. On the designer toolbar, select **Save**.
167172

168-
By default, the **Columns** property is set to automatically create the table columns based on the array items. To specify custom column headers and values, follow these steps:
173+
### Customize table format
174+
175+
By default, the **Columns** property is set to automatically create the table columns based on the array items.
176+
177+
To specify custom headers and values, follow these steps:
169178

170179
1. Open the **Columns** list, and select **Custom**.
171180

172-
1. To specify custom headers, in the **Header** property, specify the column name.
181+
1. In the **Header** property, specify the custom header text to use instead.
173182

174-
1. To specify custom values, in the **Key** property, specify the column value.
183+
1. In the **Key** property, specify the custom value to use instead.
175184

176-
> [!TIP]
177-
> To create user-friendly tokens for the properties in JSON objects so you can select those properties as inputs,
178-
> use the [Parse JSON](#parse-json-action) before calling the **Create CSV table** action.
185+
To reference and edit the values from the array, you can use the `@item()` function in the **Create CSV table** action's JSON definition.
186+
187+
1. On the designer toolbar, select **Code view**.
188+
189+
1. In the code editor, edit action's `inputs` section to customize the table output the way that you want.
179190

180-
To reference and edit the values from the array, or to edit or omit the column headers, you can use the `@item()` function. On the designer toolbar, select **Code view**. Edit the action's definition to use only the `value` property in the `columns` array object, and omit the `header` property, for example:
191+
This example returns only the column values and not the headers by omitting the `header` property and referencing the values in each `value` property that appears in the `columns` array:
181192

182193
```json
183194
"Create_CSV_table": {
184195
"inputs": {
185196
"columns": [
186-
{ "value": "@item()?['Id']" },
187-
{ "value": "@item()?['Subject']" }
188-
]
197+
{
198+
"header": "",
199+
"value": "@item()?['Description']"
200+
},
201+
{
202+
"header": "",
203+
"value": "@item()?['Product_ID']"
204+
}
205+
],
206+
"format": "CSV",
207+
"from": "@variables('myJSONArray')"
189208
}
190209
}
191210
```
192211

212+
Here is the result that this example returns:
213+
214+
```text
215+
Results from Create CSV table action:
216+
217+
Apples,1
218+
Oranges,2
219+
```
220+
221+
In the designer, the **Create CSV table** action now appears this way:
222+
223+
!["Create CSV table" with no column headers](./media/logic-apps-perform-data-operations/create-csv-table-no-column-headers.png)
224+
193225
For more information about this action in your underlying workflow definition, see the [Table action](../logic-apps/logic-apps-workflow-actions-triggers.md#table-action).
194226

195227
### Test your logic app
@@ -242,37 +274,69 @@ If you prefer working in the code view editor, you can copy the example **Create
242274

243275
![Select array output for creating HTML table](./media/logic-apps-perform-data-operations/configure-create-html-table-action.png)
244276

277+
> [!TIP]
278+
> To create user-friendly tokens for the properties in JSON objects so you can select
279+
> those properties as inputs, use the [Parse JSON](#parse-json-action) before calling
280+
> the **Create HTML table** action.
281+
245282
Here is the finished example **Create HTML table** action:
246283

247284
![Finished "Create HTML table" action](./media/logic-apps-perform-data-operations/finished-create-html-table-action.png)
248285

249286
1. Save your logic app. On the designer toolbar, select **Save**.
250287

251-
By default, the **Columns** property is set to automatically create the table columns based on the array items. To specify custom column headers and values, follow these steps:
288+
### Customize table format
289+
290+
By default, the **Columns** property is set to automatically create the table columns based on the array items.
291+
292+
To specify custom headers and values, follow these steps:
252293

253294
1. Open the **Columns** list, and select **Custom**.
254295

255-
1. To specify custom headers, in the **Header** property, specify the column name.
296+
1. In the **Header** property, specify the custom header text to use instead.
256297

257-
1. To specify custom values, in the **Key** property, specify the column value.
298+
1. In the **Key** property, specify the custom value to use instead.
258299

259-
> [!TIP]
260-
> To create user-friendly tokens for the properties in JSON objects so you can select those properties as inputs,
261-
> use the [Parse JSON](#parse-json-action) before calling the **Create CSV table** action.
300+
To reference and edit the values from the array, you can use the `@item()` function in the **Create HTML table** action's JSON definition.
301+
302+
1. On the designer toolbar, select **Code view**.
303+
304+
1. In the code editor, edit action's `inputs` section to customize the table output the way that you want.
262305

263-
To reference and edit the values from the array, or to edit or omit the column headers, you can use the `@item()` function. On the designer toolbar, select **Code view**. Edit the action's definition to use only the `value` property in the `columns` array object, and omit the `header` property, for example:
306+
This example returns only the column values and not the headers by omitting the `header` property value and referencing each `value` property that appears in the `columns` array:
264307

265308
```json
266309
"Create_HTML_table": {
267310
"inputs": {
268311
"columns": [
269-
{ "value": "@item()?['Id']" },
270-
{ "value": "@item()?['Subject']" }
271-
]
312+
{
313+
"header": "",
314+
"value": "@item()?['Description']"
315+
},
316+
{
317+
"header": "",
318+
"value": "@item()?['Product_ID']"
319+
}
320+
],
321+
"format": "HTML",
322+
"from": "@variables('myJSONArray')"
272323
}
273324
}
274325
```
275326

327+
Here is the result that this example returns:
328+
329+
```text
330+
Results from Create HTML table action:
331+
332+
Apples 1
333+
Oranges 2
334+
```
335+
336+
In the designer, the **Create HTML table** action now appears this way:
337+
338+
!["Create HTML table" with no column headers](./media/logic-apps-perform-data-operations/create-html-table-no-column-headers.png)
339+
276340
For more information about this action in your underlying workflow definition, see the [Table action](../logic-apps/logic-apps-workflow-actions-triggers.md#table-action).
277341

278342
### Test your logic app
11.6 KB
Loading
11.6 KB
Loading

0 commit comments

Comments
 (0)