# メールの添付ファイルを保存の条件

**URL:** <https://forum.uipath.com/t/topic/561643>\
**Category:** フォーラム\
**Created:** [July 9, 2023, 7:41am UTC](https://forum.uipath.com/t/topic/561643 "2023-07-09T07:41:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ru-32](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@ru-32](https://forum.uipath.com/u/ru-32)\
**Post date:** [July 9, 2023, 7:41am UTC](https://forum.uipath.com/t/topic/561643/1 "2023-07-09T07:41:09Z")

</div>

Gmailの受診トレイ内に届いたメールから添付ファイルを保存するときに、特定の期間で届いたものだけを保存したいです。  
例えば、月初めから実行ボタンを押す前日までとしたいです。変数に何日から何日の間のように入れて条件にしようとしたのですが、メールの添付ファイルを保存だと日付が特定のものしか選べずできません。  
良い方法があるでしょうか？

---

<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:** [July 9, 2023, 11:20pm UTC](https://forum.uipath.com/t/topic/561643/2 "2023-07-09T23:20:22Z")

</div>

Duplicated post

> [@メールの添付ファイルを保存の条件](https://forum.uipath.com/t/topic/561645):
>
> Gmailに一定期間の間にのみ届いた添付ファイルをもったメールから添付ファイルを保存したいです。 期間は月初めから実行する前日までです。 変数に取りたい期間を入れてフィルターとすることを考えたのですが、メールの添付ファイルを保存の条件で日付が決められた日数しか選べないためできませんでした。 何か方法はあるでしょうか？

---

<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:** [July 10, 2023, 1:56am UTC](https://forum.uipath.com/t/topic/561643/3 "2023-07-10T01:56:41Z")

</div>

Hi @ru-32  
1.Install the UiPath.GSuite.Activities package  
2.Authenticate with the Gmail API  
3.Retrieve emails Using the Get Mail Messages activity within the GSuite Application Scope to fetch the emails from your Gmail inbox. In the properties of this activity, you can set the Filter property to specify the desired date range. You can use the following filter expression:

**“newer:2023/07/01 after:2023/07/01 before:2023/07/08”**

4.Save the attachements.

Hope it helps!!

---

<div class="post-metadata">

**Author:** ![ru-32](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@ru-32](https://forum.uipath.com/u/ru-32)\
**Post date:** [July 10, 2023, 4:27am UTC](https://forum.uipath.com/t/topic/561643/4 "2023-07-10T04:27:02Z")

</div>

お二人ともありがとうございます。うまく接続ができず？投稿が2重になってしまったようです。ありがとうございました。

---

<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:** [July 13, 2023, 4:27am UTC](https://forum.uipath.com/t/topic/561643/5 "2023-07-13T04:27:25Z")

</div>

Closed on July 13, 2023, 4:27am UTC

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