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 Platform Community / Forums / Power Apps / Button to open One Dri...
Power Apps
Suggested Answer

Button to open One Drive subfolder from Sharepoint list

(0) ShareShare
ReportReport
Posted on by 12
I have a Sharepoint list customised form with Students.  Each record has a corresponding One Drive subfolder, e.g. https://school.sharepoint.com/itdirector/Year10/Student%20Name
 
The student name is a textinputbox concatenated with Lastname and Firstname - concatenate(datacardvalue8.text," ",datacardvalue13.text)
The "root" is a textinputbox with value "https://school.sharepoint.com/itdirector/Year10/"
 
I have another textinputbox "Target" to concatenate the root and the name, and a button with Launch(target.text)
 
I found I had to replace the space in the name with %20 - which works most of the time.  However, with some names, it only works with %20%20
There are no double spaces between any first names and last names  (i.e. no names with incorrect leading or trailing spaces)
 
Can anyone explain why some concatenated names need %20, and some need %20%20?   If I could understand the logic I could use it to create the correct target string.
 
Thanks in advance
 
  • vipuljain03 Profile Picture
    703 Super User 2026 Season 1 on at
    When concatenating strings, if there are any hidden or extra spaces in the "Text" values of your Datacard, they will be encoded as %20 in the URL.
     
    My suggestions are below:
     
    1. Use Trim function in Power Apps to remove all leading and trailing spaces from your input values:
    Concatenate(
        Trim(DataCardValue8.Text), 
        " ", 
        Trim(DataCardValue13.Text)
    )
     
    2. Use the Substitute function to replace any potential hidden or non-breaking spaces:
    Substitute(Trim(DataCardValue8.Text), " ", "")
     
    You can try the below code for your scenario:
    Concatenate(
        "https://school.sharepoint.com/itdirector/Year10/",
        Substitute(Trim(DataCardValue8.Text), " ", "%20"),
        "%20",
        Substitute(Trim(DataCardValue13.Text), " ", "%20")
    )
    ------------------------------------------------------------------
    If this reply helped you, please mark this reply as suggested answer and give it a like to help others in the community find the answer too!
     
    Thanks,
    Vipul
  • jmsKY Profile Picture
    12 on at
    Thanks but the Trim function isn't making a difference - One of the names that only works with %20&20 definitely only has one space as a folder location and as the concatenated name.
     
     
  • Suggested answer
    Inogic Profile Picture
    1,297 Moderator on at
    Hi,
     
    This issue likely arises due to hidden or non-printable characters in the concatenated string. Even though there are no visible double spaces, extra spaces or characters like CHAR(160) (non-breaking space) or zero-width spaces might be present, which can cause inconsistent URL behaviour.

    To ensure consistent URL formatting, clean the concatenated string by:
    1. Trimming spaces.
    2. Replacing multiple spaces or non-breaking spaces with a single space.
    3. Replacing spaces with %20.
    Fix:
    Replace your Target formula with this:
    Substitute(
        Trim(
            Substitute(
                Concatenate(DataCardValue8.Text, " ", DataCardValue13.Text),
                Char(160),
                " "
            )
        ),
        " ",
        "%20"
    )

    Explanation:
    • Substitute(..., Char(160), " "): Replaces non-breaking spaces with regular spaces.
    • Trim(...): Removes leading/trailing spaces.
    • Substitute(..., " ", "%20"): Replaces all spaces with %20.
    This should prevent the need for %20%20 and consistently generate correct URLs.


    Hope this helps.
     

    Thanks!

    Inogic Professional Services: Power Platform/Dynamics 365 CRM
    An expert technical extension for your techno-functional business needs
    Drop an email at crm@inogic.com 
    Service: https://www.inogic.com/services/ 
    Tips and Tricks: https://www.inogic.com/blog/ 
     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard