画面フローで動的に　今月の第1週目の日付を並べる


+ [画面フローの選択リストの選択肢を動的にしたい](https://trailhead.salesforce.com/trailblazer-community/feed/0D5KX00000SY0CD)

6月であれば、 
2025/05/26(月) 
2025/05/27(火) 
2025/05/28(水) 
2025/05/29(木) 
2025/05/30(金) 
2025/05/31(土) 
2025/06/01(日) 

7月であれば、 
2025/06/30(月) 
2025/07/01(火) 
2025/07/02(水) 
2025/07/03(木) 
2025/07/04(金) 
2025/07/05(土) 
2025/07/06(日) 

6月で実行した結果

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/6f32443c-ffd8-4eef-a8f9-3bd80c3fbdc6.png)


# 実際のフロー

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/60995e27-984b-4040-aa23-e079485983ca.png)

### set_baseCollection

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/68756300-3aaa-4be4-84ee-048c948ef1da.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/57e128ec-c3cb-410e-ae4b-f85ea77c5d41.png)


### baseCollectionLoop

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/89a74fe7-1f6c-4c37-82b5-8bcb85298b07.png)

### set_DummyRecordSingle

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/e06d4756-30c0-44c1-95cf-5ca2453a7d1d.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/1dfbc61b-661c-47fe-bf33-92d4034083b6.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/2d626b03-3614-4872-b67b-04c63786c7fc.png)

```
DATE( Year({!$Flow.CurrentDate}),Month({!$Flow.CurrentDate}),1 )
```

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/02da17b3-9fb9-4a3d-a7c9-38bca0c5825c.png)

```
CASE(WEEKDAY(DATE( Year({!T}),MONTH({!T}),1 )),
1,CASE({!baseCollectionLoop},"01",TEXT({!T}-6)+"(月)","02",TEXT({!T}-5)+"(火)","03",TEXT({!T}-4)+"(水)","04",TEXT({!T}-3)+"(木)","05",TEXT({!T}-2)+"(金)","06",TEXT({!T}-1)+"(土)",TEXT({!T})+"(日)"),
2,CASE({!baseCollectionLoop},"01",TEXT({!T})+"(月)","02",TEXT({!T}+1)+"(火)","03",TEXT({!T}+2)+"(水)","04",TEXT({!T}+3)+"(木)","05",TEXT({!T}+4)+"(金)","06",TEXT({!T}+5)+"(土)",TEXT({!T}+6)+"(日)"),
3,CASE({!baseCollectionLoop},"01",TEXT({!T}-1)+"(月)","02",TEXT({!T})+"(火)","03",TEXT({!T}+1)+"(水)","04",TEXT({!T}+2)+"(木)","05",TEXT({!T}+3)+"(金)","06",TEXT({!T}+4)+"(土)",TEXT({!T}+5)+"(日)"),
4,CASE({!baseCollectionLoop},"01",TEXT({!T}-2)+"(月)","02",TEXT({!T}-1)+"(火)","03",TEXT({!T})+"(水)","04",TEXT({!T}+1)+"(木)","05",TEXT({!T}+2)+"(金)","06",TEXT({!T}+3)+"(土)",TEXT({!T}+4)+"(日)"),
5,CASE({!baseCollectionLoop},"01",TEXT({!T}-3)+"(月)","02",TEXT({!T}-2)+"(火)","03",TEXT({!T}-1)+"(水)","04",TEXT({!T})+"(木)","05",TEXT({!T}+1)+"(金)","06",TEXT({!T}+2)+"(土)",TEXT({!T}+3)+"(日)"),
6,CASE({!baseCollectionLoop},"01",TEXT({!T}-4)+"(月)","02",TEXT({!T}-3)+"(火)","03",TEXT({!T}-2)+"(水)","04",TEXT({!T}-1)+"(木)","05",TEXT({!T})+"(金)","06",TEXT({!T}+1)+"(土)",TEXT({!T}+2)+"(日)"),
  CASE({!baseCollectionLoop},"01",TEXT({!T}-5)+"(月)","02",TEXT({!T}-4)+"(火)","03",TEXT({!T}-3)+"(水)","04",TEXT({!T}-2)+"(木)","05",TEXT({!T}-1)+"(金)","06",TEXT({!T})+"(土)",TEXT({!T}+1)+"(日)"))
```

### set_DummyCollection

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/692128d2-7951-4a36-bf9d-3cf346193916.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/0c1ac2a6-7929-4904-a317-478e08d843df.png)


### 画面

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/5fb4d537-73fd-4341-b4a4-72022bbeb510.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/e91165d2-b35f-402c-b576-3d9a7d562ae2.png)

#