---
title: connpass API で直近のイベントを効率よくGetしてみた話
tags:  #power automate #power platform  
author: [ふらり](https://www.docswell.com/user/fworlddocs)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/K7426W62J1.jpg?width=480
description: 気ままに勉強会 #56 でLTさせて頂いた内容です。 https://kimamani.connpass.com/event/283783/ connpass API 便利なので是非使ってみてください！
published: May 20, 23
canonical: https://www.docswell.com/s/fworlddocs/KVVPD4-2023-05-20-210855
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/K7426W62J1.jpg)

connpass API で
直近のイベントを
効率よくGetしてみた話
HTTP アクションでやってみた
@flali_world
気ままに勉強会 #56
2023/05/20


# Page. 2

![Page Image](https://bcdn.docswell.com/page/LJ1MVYVKEG.jpg)

PROFILE
フロッキー
https://www.frog-pod.com/
NAME : ふらり @ ROBO BOY
Twitter : @flali_world
Blog : https://flali.hatenablog.com/
Docs : https://www.docswell.com/user/fworlddocs
@flali_world
2


# Page. 3

![Page Image](https://bcdn.docswell.com/page/GJW3LGLPJ2.jpg)

はじめに
本資料に掲載されている内容は、
いつか人になりたいと思っている
🤖の空想上の出来事です。
内容間違っていたらごめんなさい。
@flali_world
3


# Page. 4

![Page Image](https://bcdn.docswell.com/page/4EZVMLM6J3.jpg)

connpass 便利ですよね
https://connpass.com/
@flali_world
4


# Page. 5

![Page Image](https://bcdn.docswell.com/page/Y765NWNLEV.jpg)

参加しているコミュニティの今後の開催予定がほしい
参加コミュニティの開催予定のイベントだけ一覧表示する機能がない…
引用 : 所属グループ一覧 - connpass
@flali_world
5


# Page. 6

![Page Image](https://bcdn.docswell.com/page/G75Y5M5M74.jpg)

そんなときは、connpass API
イベントの検索と取得(Get)ができます。認証不要でシンプルなAPI。
引用 : APIリファレンス - connpass
@flali_world
6


# Page. 7

![Page Image](https://bcdn.docswell.com/page/9J2GN9NRJR.jpg)

HTTP アクション を利用します。（Premiumコネクタ）
リクエストはGETのみ
series_id : グループID
グループごとに固有の番号
order : ソート 2は開催日時順
count : 取得件数 100件
時間の関係上、詳しくはBlogで
ym : イベント開催年月で検索
2023年5月なら 202305
フロー実行時の当月と翌月に
なるようにしたい
@flali_world
7


# Page. 8

![Page Image](https://bcdn.docswell.com/page/DEYVP4P5EM.jpg)

〈参考:〉connpass グループid(series_id)の一覧
series_id コミュニティ名
URL
2438Japan Microsoft 365 Users Group
https://jpo365ug.connpass.com/
3366Power BI 勉強会
https://powerbi.connpass.com/
6192Japan Power Apps User Group
https://powerapps.connpass.com/
6423Japan Power Platform User Group 名古屋 https://paandflow.connpass.com/
6950Japan Power Platform User Group
https://power-platform.connpass.com/
10313Japan M365 Dev User Group
https://jpm365dev.connpass.com/
10631おうじゃさんといっしょ
https://oujasan-to-issho.connpass.com/
10768Power BI Weekly News
https://pp-weeklynews.connpass.com/
11020Power Automate Desktop勉強会
https://powerautomatedesktop.connpass.com/
12133気ままに勉強会
https://kimamani.connpass.com/
12508Japan Power Platform Conference
https://powerplatformconf.connpass.com/
12607Japan Power Platform Game Builders
https://jppgb.connpass.com/
13103Power Apps Weekly News
https://appsweeklynews.connpass.com/
13301Learning Commons for Power Platform
https://kuro.connpass.com/
13340ふらっと純喫茶
https://flali.connpass.com/
【Power Automate】connpass のイベントを取得する5(いろいろまとめる編) - ふらりのメモ書き (hatenablog.com)
@flali_world
8


# Page. 9

![Page Image](https://bcdn.docswell.com/page/VJNM5Y5478.jpg)

出力の本文(body)の自分がほしい部分を確認する
データ全体
body(&#039;HTTP&#039;)
欲しいのは破線の “events”
body(&#039;HTTP&#039;)?[&#039;events&#039;]
他のイベントがあればこの後に続いている
@flali_world
9


# Page. 10

![Page Image](https://bcdn.docswell.com/page/YE9NYPY4E3.jpg)

実行時以降のこれから開催したいものに絞る
現在時刻より後（大きい）イベントでフィルターします。
body(&#039;HTTP&#039;)?[&#039;events&#039;]
item()?[&#039;started_at&#039;]
addHours(utcNow(), 9)
@flali_world
10


# Page. 11

![Page Image](https://bcdn.docswell.com/page/GE8K6D6V7D.jpg)

取得したデータの順番を変更します。
開催日時の降順で並んでいるので、Sort関数を使って昇順に変更します。
Sort(body(&#039;アレイのフィルター処理&#039;),&#039;started_at&#039;)
@flali_world
11


# Page. 12

![Page Image](https://bcdn.docswell.com/page/LELZ9M9RJR.jpg)

必要なデータに絞りつつ、開始終了日時に変換します。
選択アクション内で、開始日時 – 終了日時 にフォーマットを変換しています。
item()[&#039;event_id&#039;]
item()[&#039;title&#039;]
item()[&#039;event_url&#039;]
item()[&#039;hash_tag&#039;]
concat(formatDateTime(addHours(item()[&#039;started_at&#039;],9),&#039;yyyy/mm/dd ddd HH:mm&#039;,&#039;ja-JP&#039;),&#039; - &#039;,formatDateTime(addHours(item()[&#039;ended_at&#039;],9),&#039;yyyy/mm/dd ddd HH:mm&#039;,&#039;ja-JP&#039;))
@flali_world
12


# Page. 13

![Page Image](https://bcdn.docswell.com/page/4JMVZYZPJW.jpg)

オブジェクト({})の項目を１行テキストに変換しています。
改行コードを挟みながらオブジェクトを1行のテキストデータに変換しています。
body(&#039;選択&#039;)
concat 関数で改行コードを挟みながら1行にします。
concat(
item()[&#039;event_datetime’],
decodeUriComponent(&#039;%0D%0A’),
item()[&#039;title’],
decodeUriComponent(&#039;%0D%0A’)
item()[&#039;event_url’],
decodeUriComponent(&#039;%0D%0A’),
&#039;#’,
item()[&#039;hash_tag’]
)
@flali_world
13


# Page. 14

![Page Image](https://bcdn.docswell.com/page/PJR2696YE9.jpg)

オブジェクト({})の項目を１行テキストに変換しています。
改行コードを挟みながらオブジェクトを1行のテキストデータに変換しています。
[{
title
,
event_url
,
event_datatime
,
hash_tag
{
},
title
,
event_url
,
event_datatime
,
hash_tag
{
},
title
,
event_url
,
event_datatime
,
hash_tag
[“
title ⏎ event_url ⏎ event_datatime ⏎
hash_tag
“,
“
title ⏎ event_url ⏎ event_datatime ⏎
hash_tag
“,
“
title ⏎ event_url ⏎ event_datatime ⏎
hash_tag
“]
concat(
item()[&#039;event_datetime’],
decodeUriComponent(&#039;%0D%0A’),
item()[&#039;title’],
decodeUriComponent(&#039;%0D%0A’)
item()[&#039;event_url’],
decodeUriComponent(&#039;%0D%0A’),
&#039;#’,
item()[&#039;hash_tag’]
)
}]
@flali_world
14


# Page. 15

![Page Image](https://bcdn.docswell.com/page/PEXDMQM47X.jpg)

改行コード×２で結合します。
これでほしいデータが取れるようになりました。
body(&#039;選択_2&#039;)
改行コードで結合 ⏎ ⏎
decodeUriComponent(&#039;%0D%0A%0D%0A&#039;)
@flali_world
15


# Page. 16

![Page Image](https://bcdn.docswell.com/page/3EKXG9GP7D.jpg)

実行
はい、イベントの一覧が取得できました。
⏎
⏎
⏎
⏎
⏎
⏎
⏎
⏎
⏎
⏎
⏎
⏎
@flali_world
16


# Page. 17

![Page Image](https://bcdn.docswell.com/page/L735NWN4E5.jpg)

さいごに


# Page. 18

![Page Image](https://bcdn.docswell.com/page/87DDWKW57G.jpg)

HTTP アクションの利用にはスタンドアロンライセンス
今回 Premium コネクタを利用していますので、Microsoft 365 の範囲ではでき
ません。
価格 | Microsoft Power Automate
@flali_world
18


# Page. 19

![Page Image](https://bcdn.docswell.com/page/VJPX9K9D78.jpg)

HTTP アクションが難しい場合はコネクタあります！
Miyakeさんが作成されました！(Premium コネクタ)
connpass (独立発行者) - Connectors | Microsoft Learn
@flali_world
19


# Page. 20

![Page Image](https://bcdn.docswell.com/page/2EVLMVMGJQ.jpg)

Thank you !


