Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps - Power Apps Pro Dev & ISV / 任意の形式で連番を自動生成したい
Power Apps - Power Apps Pro Dev & ISV
Answered

任意の形式で連番を自動生成したい

(1) ShareShare
ReportReport
Posted on by 8
はじめまして、powerappsでアプリを試行錯誤して作成しています。
メインの画面上部に、新規追加ボタンがあり「NewForm関数」で編集画面が新規で画面遷移します。
メインの画面中央には「部品管理リスト」を読み込んだギャラリーがあり編集ボタンを押すと「EditForm関数」で編集画面が対象のリストのデータを編集できる状態で画面遷移します。
わからない事が2つあって質問します。
1つ目は、部品管理リストの列に「管理番号」「管理場所」・・・があります。「管理番号」は例として「2025-0021」と表示します。
「管理番号」の形式は、年度(2025年度であれば、2025/4/1~2026/3/31までを2025) "-" 4桁の連番で表示します。
データを保存する「SubmitForm関数」の直前に自動で「管理番号の最大値+1」を取得して登録するにはどうしたらいいでしょうか。※年度初め(最初の登録)は最大値がない状態からの登録
2つ目は、管理番号が登録してある「管理番号リスト」があります。部品管理リストと同じく列に「管理番号」と、「管理場所」があります。
「管理番号リスト」にはあらかじめ「管理番号」「管理場所」は登録してあります。
1つ目で自動取得した「管理番号」と「管理番号リスト」の「管理番号」で一致する「管理場所」も同時に登録するにはどうしたらいいでしょうか。
 
ご教授くださいますよう、よろしくお願いいたします。
 
 
  • CU04041301-0 Profile Picture
    8 on at
    任意の形式で連番を自動生成したい
    マイケル・エ・ジェルネイ様
     
    2つ目の質問は自己解決しました。
     
    >>1つ目で自動取得した「管理番号」と「管理番号リスト」の「管理番号」で一致する「管理場所」も同時に登録してどうしたらいいでしょうか。
     
    ギャラリーの「管理場所」にLookUP関数を使用することで「管理番号リスト」の「管理番号」を読み取ることができました。
    残る1つ目の連番を取得する方法が未だわかりません。
     
    どうぞよろしくお願いします。
  • CU04041301-0 Profile Picture
    8 on at
    任意の形式で連番を自動生成したい
    マイケル・E・ジェルネイ 様
     
    ご回答ありがとうございます。
    現状の画面とやりたいことの絵を送付します。
     
    追加で必要な情報があればご連絡ください。
     
    よろしくお願いします。
    Dear Michael E. Gernay
     
    Thank you for your reply.
    I will send you a picture of the current screen and what I want to do.
     
    Please contact me if you need any additional information.
     
    Thank you in advance.
  • Verified answer
    Michael E. Gernaey Profile Picture
    39,785 Super User 2025 Season 1 on at
    任意の形式で連番を自動生成したい
     
     
    please use pictures not just words to describe so we can see what you see and mark up the pictures.
     
    Share your Data schema, so we follow better, please make sure to visualize it so we can know whats in your head exactly.
     
    However, what you are asking for while, technically doable, is going to cause you issues in the long run if multiple people are submitting at the same time, they will very possibly get the same "max" value that you want, and then you will unintentionally duplicate the new value. 
     
    would need to discuss in much more depth.
     
    Again please share more details on the Schema of the Data and mark up pictures
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,756 Most Valuable Professional

Leaderboard