Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Sharelink with external user + expiration

(0) ShareShare
ReportReport
Posted on by 155

Hello!

I have a Send an http request that sends a sharelink to an external user. This link has a feature I was looking for which is the code verification requirement without having to type your email.

 

image.png

 

Now I would like to set a specific expiration on this link (7 days). I tried to replace null with a specific date like "2023-02-05" or variables such as utcnow + add days (1) and none of my tried worked. Would someone here know what I'm doing wrong? The option is there and set to null so I guess there is a way to modify it, right?

 

By the way, thanks to this post I was able to get this far.

  • Volt26 Profile Picture
    155 on at
    Re: Sharelink with external user + expiration

    Then you proved me it can work. It is most likely because the option isn't set by the admin. I'll wait for a reply from them... Thank you! I'll mark your answer as Accepted solution!

  • Expiscornovus Profile Picture
    31,891 Most Valuable Professional on at
    Re: Sharelink with external user + expiration

    Hi @Volt26,

     

    I tried to reproduce your issue in my environment, but I was unable to. In my setup I have set the expiry date to 16:30 via a flow for an anonymous link:

     

    {"request":{"createLink":true,"settings":{"allowAnonymousAccess":true,"trackLinkUsers":false,"linkKind":5,"expiration":"20230203T163000-0000","role":2,"restrictShareMembership":false,"updatePassword":false,"password":"","scope":0}}}

     

    2. The interface shows this time for the anonymous link

     

    testingaccess_expiry.png

     

    3. When I navigate to that link in an in-private browsing session I get an expired message for the anonymous link at 04:31 PM (ignore the 08:31 AM, different time zone, lol)

    linkexpired02.png

  • Volt26 Profile Picture
    155 on at
    Re: Sharelink with external user + expiration

    Oh this is great, I don't get an error anymore! The script works but there is an issue. After the link expires, the external user can still access the folder and write in it as if the link never expires..

     

    Screenshot of the folder access BEFORE expiration (it was 10h57 and expiration was set for 11h00) :
    image.png

     

    At 11:01 I looked again at the access rights of the folder and here is what I see :

    image.png

     

    I logged on my other computer to make sure it had nothing to do with my member access (this 2nd computer never logs in there other than with an external link). This external user is still able to access the folder and upload files.

     

    I think the script works. Maybe it is something that has to be done in the Sharepoint settings itself?

    I noticed this :

    image.png

    image.png

     

    So my guess is that to make it work, I probably need to follow this tutorial : New Expiring Access Policy to Control Guest Access to SharePoint Online Sites | Practical365 under the "Site-Specific Expiration Settings" section. Unfortunately I don't have the access to change that setting. I sent a request to our IT admin. I expect long delays before they even understand what I'm talking about.

     

    Would someone know of another way? I guess there is none but it's worth asking.

     

    Thank you very much Expiscornovus for giving me the answer!

  • Verified answer
    Expiscornovus Profile Picture
    31,891 Most Valuable Professional on at
    Re: Sharelink with external user + expiration

    Hi @Volt26,

     

    You forgot the quotes around the value. Can you add those?

  • Volt26 Profile Picture
    155 on at
    Re: Sharelink with external user + expiration

    Unfortunately I get this error (that I don't get when expiration is set to null)

    image.png

  • Expiscornovus Profile Picture
    31,891 Most Valuable Professional on at
    Re: Sharelink with external user + expiration

    Hi @Volt26,

     

    Can you try the value below for the 5th of Feb?

     

     

    20230205T000000-0000

     

     

     

    Just had a quick look in the Developer toolbar when setting this field with the 1st of March:

     

     

    {"request":{"createLink":true,"settings":{"allowAnonymousAccess":true,"trackLinkUsers":false,"linkKind":5,"expiration":"20230301T000000-0000","role":2,"restrictShareMembership":false,"updatePassword":false,"password":"","scope":0}}}

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492