web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Suggested Answer

ファイルの移動

(0) ShareShare
ReportReport
Posted on by
5桁の数字のフォルダを、同じ5桁の数字+名前のフォルダの中に移動させたい
変数がちがうのかうまくいきません
おしえてください
スクリーンショット (453).png

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

Categories:
I have the same question (0)
  • Suggested answer
    Assisted by AI
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    The solution is to:
    • Extract the first 5 digits from the source folder name
    • Find the destination folder that starts with the same 5 digits
    • Move the source folder into that matching destination folder
    The problem usually happens because:
    • The variable contains more or less than the 5 digits
    • The comparison is exact match instead of “starts with”
    • The folder list is not filtered correctly
    This can be solved using string functions and proper matching logic.

    You have this structure:
    Source Folders:
    12345
    23456
    34567
    Destination Folders:
    12345_ProjectA
    23456_ProjectB
    34567_ProjectC
     
    And you want the result to be:
    12345_ProjectA
     └─ 12345
    23456_ProjectB
     └─ 23456
    34567_ProjectC
     └─ 34567
     
    The key idea: Match folders by the first 5 digits, not the full name.

    How to do it (high‑level steps)
    General logic (works for Power Automate, PowerShell, scripts)
    1. Get the source folder name (12345)
    2. Store the 5‑digit number in a variable
    3. Loop through destination folders
    4. Check: Does the destination folder name start with the same 5 digits?
    5. If yes > move the source folder

    Key expressions:
    Get first 5 characters:
          substring(variables('SourceFolderName'), 0, 5)

    Check if destination folder starts with that number:
          startsWith(destinationFolderName, fiveDigitNumber)
     
    This avoids variable mismatch issues.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.
  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at
    hey
     
    can you please post the text in english again? I dont know if the translation was accurate enough to be able to help.
     
     
    thanks

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard