I am going to have Flows running on many sites and keeping a separate history of all approvals across all the modern sites. The flows will run on typical document libraries doing standard-like approvals. I have it all working, I just need the URL of the site collection. I've tried expressions to split the URL of a file, but struggling with where to stop. I just think Flow has to know where it is.
If I peek code at the trigger, I can see it there under parameters called dataset:
The workflow() expression only dumps info of the environment which doesn't include the site URL. Anyone know how I can reference this information? Just seems like it should be easier than this.
Solved! Go to Solution.
Hi @dougallen ,
The site Url cannot be obtained directly through For a selected file.
Please refer to the method below to get Site Url.
Expression:
first(split(body('Get_file_properties')?['{Link}'],concat('/',body('Get_file_properties')?['{Path}'])))
Image reference:
Flow run history:
Please take a try.
Best Regards,
Hi @dougallen ,
The site Url cannot be obtained directly through For a selected file.
Please refer to the method below to get Site Url.
Expression:
first(split(body('Get_file_properties')?['{Link}'],concat('/',body('Get_file_properties')?['{Path}'])))
Image reference:
Flow run history:
Please take a try.
Best Regards,
This worked, thanks!
Hi,
You can achieve the same result by using some of the properties of the SharePoint item like "Link to Item" and "Full Path".
The formula would be:
substring("Link to Item",0, length("Link to Item")-lenght("Full Path")-1)
Regards,
Kailash
@KailashK i am in need of the site url too and i saw your formula but it isnt working for me. Can you help me fix this?
Hi @skarthanal ,
My mistake, I was lazy in posting my last reply and you have some bracketing errors in your expression. *hint: Use Notepad++ to write up the expressions*.
You cannot use a minus directly in an expression. You need to use sub instead. Your expression after correction should look like this:
substring(outputs('Get_file_properties')?['body/{Link}'],0,sub(length(outputs('Get_file_properties')?['body/{Link}']),length(outputs('Get_file_properties')?['body/{FullPath}'])))
Regards,
Kailash
@dougallen I got this to work on the datset value that you mentioned:
trigger()['inputs']['parameters']['dataset']
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
User | Count |
---|---|
78 | |
20 | |
17 | |
14 | |
13 |
User | Count |
---|---|
134 | |
35 | |
30 | |
29 | |
25 |