Hello!, I'm hoping someone can help.
I'm trying to use "Replace" within an expression to replace a part of an URL to redirect files from SharePoint library to sharepoint library. I am certainly not a programmer so I have a lot of trouble understanding how to properly use expressions.
For a little more context why I want to achieve this. see my other post.
2
hi @S_J_G I hope this could guide you
So first I asume you have the link to the library one, so what I did was just extract the word libraryone dynamically, so as you see in my first compose I have just the link then in the secod I get the lenght of my link thats because in substring I need that value.
In the compose GetPosLibOne I just get the position of the word libraryone and then in the next compose I use the outputs of my previus compose's to get just the word libraryone using substring to finally use that word to replace it in the second link.
This was my result
hi @ChristianAbata , ty for your reply!
In the meantime I have taken a different direction. I don't think I need the "append to string" anymore, I maybe can put the output from "target path" in the action "create file" --> folderpad.
i still cant get a proper replace action working. stil trying to do the following;
https://Xonline.sharepoint.com/teams/project X/libraryone/folder 1/sub folder 1.1
replace whit;
https://Xonline.sharepoint.com/teams/project X/librarytwo/folder 1/sub folder 1.1
I need to replace the red part with the green part. But the purple part is not static but needs to stay the same as source file.
so i cant simpely use the a static URL in the Replace function.
I need to know the folder path for each source file then i need to be able to use the "folder path" in the replace fuction, i think.
Or maybe first split the URL somehow, and append later on.
hi @S_J_G just to understhand you are creating a varible with this value : Teams/Zudplasol...../Actuale.... so what is this friend?
second you are using append variable this actions means that you are going to add some data to you initial variable like concatenate so why tou leave this empy?
I assume that I am so far off that it is no longer worth responding haha
.but thanks anyways.
Hallo @v-alzhan-msft,
The purpose of the expression should be to archive the following;
I am trying to copy files from one library to an other. But which folder/sub folder is variable, it depends on where the source file is located. but these folder structure is completely the same between the 2 librarys.
https://Xonline.sharepoint.com/teams/project X/libraryone/folder 1/sub folder 1.1
replace whit;
https://Xonline.sharepoint.com/teams/project X/librarytwo/folder 1/sub folder 1.1
Reading back the expression, it really doesn't make any sense to me 🤔
I get the following error;
Hi @S_J_G ,
What is the purpose to use the expression that you provided "replace(outputs('(I)_Get_files_(properties_only)_-_Internal_workspace')?['/teams/Zuidplaspolderfase5/06 Werkdocumenten}'],'/teams/Zuidplaspolderfase5/Actuele stukken omgeving','')"?
What is the issue for the expression so the flow couldn't work? could you please share a screenshot of the flow run history?
Best Regards,
Alice
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional