# Listの内容を一括で表示させたい

**URL:** <https://forum.uipath.com/t/list/554533>\
**Category:** フォーラム\
**Tags:** collection\
**Created:** [June 16, 2023, 3:50am UTC](https://forum.uipath.com/t/list/554533 "2023-06-16T03:50:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![111860](https://avatars.discourse-cdn.com/v4/letter/1/b38774/32.png) [@111860](https://forum.uipath.com/u/111860)\
**Post date:** [June 16, 2023, 3:50am UTC](https://forum.uipath.com/t/list/554533/1 "2023-06-16T03:50:21Z")

</div>

「コレクションに項目を追加」アクティビティに例外の内容を追記しています。

最後に、「コレクションに項目を追加」で出力しているList型変数の中身を表示したいのですが、一つずつしか取り出す方法が分からず、一度にすべての内容を表示させるにはどうしたら良いでしょうか？

繰り返しを挟んでその中で代入していけば結果的にすべてを表示した文字列を作成できるとは思うのですが、遠回りせずに実現する方法があればご教示いただきたいです。

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [June 16, 2023, 3:54am UTC](https://forum.uipath.com/t/list/554533/2 "2023-06-16T03:54:45Z")

</div>

こんにちは

以下MessageBoxアクティビティ等でお試しください

```
String.Join(",",listVar)

```

または

```
String.Join(vbcrlf,listvar)

```

---

<div class="post-metadata">

**Author:** ![pravallikapaluri](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pravallikapaluri/32/484755_2.png) [@pravallikapaluri](https://forum.uipath.com/u/pravallikapaluri)\
**Post date:** [June 16, 2023, 3:58am UTC](https://forum.uipath.com/t/list/554533/3 "2023-06-16T03:58:32Z")

</div>

Hi @111860

1. Add an “Assign” activity to create a new variable of type string. Let’s name it `resultString`.
2. In the “To” field of the Assign activity, enter `resultString`.
3. In the “Value” field, use the following expression: `String.Join(", ", yourListVariable)`

Hope it helps!!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [June 20, 2023, 5:17am UTC](https://forum.uipath.com/t/list/554533/4 "2023-06-20T05:17:57Z")

</div>

Closed on June 20, 2023, 5:17am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
