Forum Discussion

bryanfrumkin47's avatar
bryanfrumkin47
Copper Contributor
Sep 14, 2023

Extract .png from person/group column

Any help would be extremely helpful, I am unable to create a solution to this issue.

 

I am looking to create a flyer generator.
Users will be using their photo associated with my SharePoint employee list, but this is my issue:


When I pull the dynamic action of a picture from a group/person column it displays a link: https://lnfcompanies.sharepoint.com/sites/SiteName/\\\\\\\\\\_layouts/15/UserPhoto.aspx?Size=L&AccountName=email address removed for privacy reasons, and once I go to this link it displays a new link: https://lnfcompanies.sharepoint.com/_vti_bin/afdcache.ashx/_userprofile/userphoto.jpg?_oat_=1694724778_b1f6f762a9b3e08a18b0e6972cb0631a3badaed82ab7210fae40e4f56cf71c1c&P1=1694707665&P2=-1205102505&P3=1&P4=pn%2bVpCQ6BCG1Wk9dlEGXck3%2bFhetPXcuGoPPchUnf79TdkZlEcxc8zKbKzg9Z9294lpey7DAWzuVwyCTfa0Ix364sqtgPyW5xdMP%2fA%2bPHFhIOPqELeYzb3MVcWaG26BZJqaTIi1JV%2bDaQKVkWe6jjQ%2bGieQ2R2RmWwlcLiuGcIfqLgL2HKdeHTqmcju5hjIMy5y4WG6BhaWK6ChF%2bmsmCqgMks%2fF2DpBbmf921oWEeypP9ujHY6cYQ%2bwOUZfH%2fMk29Z2dHV4lGxL%2bd5vaDHNjSQwlShFogedXk7G4JD%2bXVEd5WNh%2bDmfGBYmuMVeM%2fzokjoyEOt7Z5PkZ0QEP1RJXA%3d%3d&size=L&accountName=email address removed for privacy reasons&default=true

The issue I am having is that I need to display an image in my "Populate a word template" action, but I need to add file contents of a JPG or PNG image as the value. The value should look like this: { "$content-type": "image/png", "$content": "iVBORw0KG...i/DhQmCC" } where the content is the base64 encoded image.
How can I extract the image file from the redirected link, because the "Populate a word template" action requires a file and not a link.

Thank you so much.

  • SvenSieverding's avatar
    SvenSieverding
    Sep 15, 2023

    Hi bryanfrumkin47 ,

    yes, you don't need that variable.
    If you get the email as a property from your forms trigger, then you can just use that.....

    I used a variable because I did not want my email address shown in the screenshot and wanted to show you where you needed to put your dynamic values.

    With a forms trigger the example would look like this:

     

  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    Hi bryanfrumkin47 ,

    simply use the url

    /_layouts/15/userphoto.aspx?size=L&username=<useremail>

    and a "Send an HTTP Request to SharePoint" Action.
    The "body" that is returned from that action is already in the correct format.

    This is how it looks if you want to store that photo as a file

     

    But you should be able to directly put that "body" in a "Populate a word template" action.

    Best Regards,
    Sven




    • bryanfrumkin47's avatar
      bryanfrumkin47
      Copper Contributor
      Hey SvenSieverding

      Could you please provide your setup for the variable. I want to make sure I am doing this correctly. Thank you for your help.
      • SvenSieverding's avatar
        SvenSieverding
        Bronze Contributor
        That variable just contains my email address.... The one I use to log in.

        Best Regards,
        Sven

Resources