Forum Discussion

jondotgov's avatar
jondotgov
Copper Contributor
May 12, 2022

Generate URL for "Following" a SharePoint site?

I'm looking at using my teams SPO site as a way to share our updates with internal stakeholders, and I'd like to create a link that I can embed in a button or email whereby, if anyone who gets the email clicks the link, it "follows" our SPO site, essentially mimicking the process that they'd normally follow by visiting the site and clicking on the "Follow" button:

Is this something I can do? I wondered if there might be a way to build an Automate flow that accomplishes the same thing if this isn't possible. I tried looking into the page source code but that didn't give me any good information or avenues forward

  • YvonneEGrant's avatar
    YvonneEGrant
    Copper Contributor
    Did anyone every come up with a fix for this - trying to do the same thing and I know it's possible as have seen it done but cannot work out how....?
  • TatianaKislitsa's avatar
    TatianaKislitsa
    Copper Contributor
    Hi! Did you find a solution by any chance? This is exactly what I need, so it would be lovely to know how to do 🙂 Cheers!
  • TatianaKislitsa's avatar
    TatianaKislitsa
    Copper Contributor

    jondotgov I have found a workaround of sorts, working with Power Automate and HTTP requests to SharePoint. It's not an ideal solution, but it's the closest I could find without a complicated authorisation procedure (I analysed the API request done when clicking that star, it's OneDrive for some reason and it requires an authorisation token):

    I made a SP list with a button "follow" that initiates this flow (you can think of a possible other trigger for the flow)
    Then, I collect the email of the person who clicked it and use it in the following request:

    You can pack the site name into a variable as well, and replace "Demo_IT" with it.

    The problem with this API  call is, while you now see this site among your followed sites on the SharePoint page and in the navigation on your left (eventually, the site takes a while to appear there), the star on the site still appears as if you are not following it. The reason is possibly because when you look at what happens when you click the star, this is a OneDrive request (don't ask me why):

    So, this is what I was able to do so far. I hope it helps. If you find a way gto actually use the OneDrive API in a flow or link successfully, let me know!

     

Resources