Unable to Download QR Code from SharePoint List in Form of an Image? We’ve Got You Covered!
Image by Corita - hkhazo.biz.id

Unable to Download QR Code from SharePoint List in Form of an Image? We’ve Got You Covered!

Posted on

Are you tired of struggling to download QR codes from SharePoint lists in the form of an image? You’re not alone! Many users face this issue, and it can be frustrating, to say the least. But fear not, dear reader, for we’re about to guide you through the process of downloading QR codes as images from SharePoint lists.

When you try to download a QR code from a SharePoint list, you might be surprised to find that instead of getting the QR code as an image, you’re given a link to the QR code instead. This can be problematic, especially if you need to use the QR code in a specific context, such as printing it on a label or displaying it on a website.

So, why does SharePoint do this? Well, it’s because SharePoint treats QR codes as a type of link, rather than an image. This means that when you try to download the QR code, SharePoint provides you with the link instead of the image itself.

The Solution: Using Power Automate (formerly Microsoft Flow)

Fear not, dear reader, for there is a solution to this problem! You can use Power Automate (formerly Microsoft Flow) to download QR codes from SharePoint lists as images. But before we dive into the steps, let’s take a look at what Power Automate is and why it’s the perfect tool for the job.

What is Power Automate?

Power Automate is a cloud-based workflow automation platform that allows you to automate repetitive tasks and processes across multiple applications and services. It’s part of the Microsoft Power Platform, which also includes Power Apps and Power BI.

With Power Automate, you can create custom workflows that automate tasks, such as downloading QR codes from SharePoint lists, with ease.

Step-by-Step Guide to Downloading QR Codes as Images using Power Automate

Now that we’ve covered the basics, let’s get started with the step-by-step guide. Follow along, and you’ll be downloading QR codes as images in no time!

  1. Create a new Power Automate flow by logging into your Power Automate account and clicking on the “Create from blank” button.

  2. Search for the “SharePoint” connector and select it. Then, choose the “List” trigger and select the SharePoint list that contains the QR code you want to download.

  3. Configure the trigger to retrieve the QR code from the SharePoint list. You can do this by specifying the column that contains the QR code and setting the trigger to retrieve the QR code when an item is created or updated.

  4. Add an action to the flow by clicking on the “Add an action” button. Search for the “HTTP” connector and select it.

  5. Configure the HTTP action to send a GET request to the QR code URL. You can do this by specifying the URL of the QR code and setting the request method to GET.

  6. Add another action to the flow by clicking on the “Add an action” button. Search for the “Image” connector and select it.

  7. Configure the Image action to convert the QR code response from the HTTP action into an image. You can do this by specifying the response from the HTTP action as the input for the Image action.

  8. Add a final action to the flow by clicking on the “Add an action” button. Search for the “File” connector and select it.

  9. Configure the File action to save the QR code image to a file. You can do this by specifying the file path and filename, as well as the image output from the Image action.

And that’s it! Your Power Automate flow is now configured to download QR codes from SharePoint lists as images. You can test the flow by creating a new item in the SharePoint list or updating an existing item. The flow will automatically download the QR code as an image and save it to the specified file path.

The Solution: Using SharePoint REST API and JavaScript

Another solution to downloading QR codes from SharePoint lists as images is to use the SharePoint REST API and JavaScript. This method requires some programming knowledge, but it’s a great option if you’re comfortable with coding.

What is the SharePoint REST API?

The SharePoint REST API is a set of APIs that allow you to interact with SharePoint data and services programmatically. You can use the REST API to retrieve data from SharePoint lists, libraries, and other services, as well as to create, update, and delete items.

In this case, we’ll use the SharePoint REST API to retrieve the QR code from the SharePoint list and then use JavaScript to convert the QR code into an image.

Step-by-Step Guide to Downloading QR Codes as Images using SharePoint REST API and JavaScript

Now that we’ve covered the basics, let’s get started with the step-by-step guide. Follow along, and you’ll be downloading QR codes as images using SharePoint REST API and JavaScript in no time!

  1. Create a new JavaScript file or add the code to an existing file.

  2. Use the SharePoint REST API to retrieve the QR code from the SharePoint list. You can do this by making a GET request to the SharePoint list REST endpoint and specifying the column that contains the QR code.


    const apiUrl = '/_api/web/lists/GetByTitle(\'Your List Title\')/items?$select=QRCodeColumn';
    const headers = {
    'Accept': 'application/json;odata=verbose',
    'Content-Type': 'application/json;odata=verbose'
    };

    fetch(apiUrl, {
    headers: headers,
    method: 'GET'
    })
    .then(response => response.json())
    .then(data => {
    const qrCodeUrl = data.d.results[0].QRCodeColumn.Url;
    // Convert the QR code URL to an image
    })
    .catch(error => console.error(error));

  3. Use the QR code URL to create a new image element and set the source of the image to the QR code URL.


    const img = document.createElement('img');
    img.src = qrCodeUrl;
    document.body.appendChild(img);

  4. Use the HTML Canvas element to convert the QR code image into a downloadable image. You can do this by creating a new canvas element, setting the canvas width and height to the desired size, and then drawing the QR code image onto the canvas.


    const canvas = document.createElement('canvas');
    canvas.width = 200;
    canvas.height = 200;
    const ctx = canvas.getContext('2d');
    ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
    const imageData = canvas.toDataURL('image/png');

  5. Use the download attribute of the anchor element to create a downloadable link for the QR code image. You can do this by creating a new anchor element, setting the href attribute to the image data URL, and then setting the download attribute to the desired filename.


    const a = document.createElement('a');
    a.href = imageData;
    a.download = 'qr-code.png';
    document.body.appendChild(a);
    a.click();

And that’s it! Your JavaScript code is now configured to download QR codes from SharePoint lists as images. You can test the code by running it in a JavaScript console or adding it to a SharePoint page.

Conclusion

In this article, we’ve covered two solutions to downloading QR codes from SharePoint lists as images: using Power Automate (formerly Microsoft Flow) and using SharePoint REST API and JavaScript. Both solutions are effective and can be used to automate the process of downloading QR codes as images.

Remember, if you’re not comfortable with coding, the Power Automate solution is a great option. It’s easy to use and doesn’t require any programming knowledge. On the other hand, if you’re comfortable with coding, the SharePoint REST API and JavaScript solution provides more flexibility and customization options.

Either way, you’re now equipped with the knowledge and tools to download QR codes from SharePoint lists as images. Happy automating!

Solution Description Pros Cons
Power Automate Use Power Automate to automate the process of downloading QR codes as images from SharePoint lists Easy to use, no coding required, flexible and customizable Requires Power Automate subscription, may require additional setup and configuration
SharePoint REST API and JavaScript Use SharePoint REST API and JavaScript to download QRHere is the HTML code for 5 FAQs about “not able to download QR code from SharePoint list in form of an image but giving link of the QR code”:

Frequently Asked Questions

Having trouble downloading QR codes from SharePoint lists? Don’t worry, we’ve got you covered!

Why am I getting a link instead of a downloadable QR code image?

This is likely due to the SharePoint list settings. Make sure the QR code column is set to “Image” and not “Hyperlink” or “Text”. Also, check if the QR code generator is configured to produce a downloadable image.

How can I configure the QR code generator to produce a downloadable image?

You can configure the QR code generator by going to the SharePoint list settings, then click on “Add a column” and select “QR Code”. In the QR code settings, select the “Image” option under “Output type”. Make sure to save your changes!

What if I want to download multiple QR codes at once?

You can use SharePoint’s built-in “Export to CSV” feature to download multiple QR codes as images. Simply select the rows you want to export, click on the “Files” tab, and choose “Export to CSV”. Then, you can use a third-party tool to convert the CSV file to individual QR code images.

Can I customize the appearance of the QR code image?

Yes, you can customize the appearance of the QR code image by using a third-party QR code generator or a custom solution. You can also use SharePoint’s “Column formatting” feature to customize the QR code display, such as changing the size, color, or background image.

What are some common issues that might prevent me from downloading the QR code image?

Common issues that might prevent you from downloading the QR code image include incorrect SharePoint list settings, QR code generator misconfiguration, or browser caching issues. Try clearing your browser cache, checking the SharePoint list settings, and re-configuring the QR code generator to resolve these issues.