I am creating an app where people can offer or inquire goods and stuff inside my company. To make life easier for my co-workers we let them attach files to the list item to be used as images. Also they can select one main image which will show up in the gallery on the first screen. The URL to the main image is saved in a column and at runtime an image control is fed with the URL.
Strangely, behavior differs among browsers and also people.
IE does not work it all. When trying to retrieve the image, O365 returns an HTTP 302 and in the location header we find this:
(I switched the subdomain for anonymizing purposes).
As you can see, SharePoint requires me to authenticate which is quite dull, because I am using the PowerApp and should be autheticated against Office 365.
Is there anything I am doing wrong?
Hi @skcv ,
Could you please share more details about the error message within your app?
How do you retrieve the image within your app? Could you please share a bit more about the formula?
Further, could you please show more details about the URL you saved in your SP List? Which type column do you use to store the URL?
Please consider re-create a new connection to your SP List and Office 365 connnection from your app, then try your formula again, check if the issue is solved.
As an alternative soution, you could consider use the Attachments control to attach image files into your SP List Item. Within the Edit form of your app, you could enable the "Attachment" field. Then you could use the Attachments control to upload images to your SP List Item.
Please check and see if the following blog would help in your scenario:
Hello, @v-xida-msft, thank you for your reply,
as stated in my initial post, when I open my PowerApp I find a gallery that has image controls. When IE tries to load the images for each gallery entry it receives an HTTP 302 and the URL in the location header of the response points to
When I view the response in IE's developer tools I am presented with an HTML page. Of course PowerApps cannot render said HTML in an image tag so nothing at all is shown.
Any image shown there must first be attached to the list item via attachment control - we provide the end user with that. Afterwards the end user can select a main image via a list box control whose URL is then stored in a single line text column. We first tried to use the URL/Image column type but it appears this one cannot be updated from PowerApps, unfortunately (or rather: we couldn't make it work).
I will now try to export and re-import the app, maybe this will solve the issue.
Re-importing did not help - now I even have the problem that I cannot see images in my Chrome development session. Is there any way I can force the data source confirmation prompt to re-appear? This didn't happen neither in IE nor Chrome nor Firefox on the attempt to launch the re-imported app for the first time. In Edge it works, though.
Furthermore in Firefox I receive
XML-Processing error: Could not find root element Address: https://api.powerapps.com/api/invoke row 1, column 1:
Chrome gives me an HTTP 400 in gallery.js:
GET https://tenant.sharepoint.com/_forms/default.aspx?ReturnUrl=%2fsites%2fMarketplace%2f_layouts%2f15%2fAuthenticate.aspx%3fSource%3d%252Fsites%252FMarketplace%252FLists%252FMarketplace%252FAttachments%252F5%252F2018%252DFashion%252DBicycle%252DClassical%252DCity%252DBike%252D700%252Dcc%252DVintage%252DBicycle%252Ejpg&Source=cookie 400
I am thinking of filing a ticket with Microsoft.
Thank you for your help.
To elaborate further on your questions:
- I do not receive an error message in PowerApps, solely when I use the developer tools I find that when the browser requests the images it receives an HTTP 302 and in the location header I find somethin similar to
(Please note the Authenticate.aspx page)
- I retrieve the image using an image control and binding its default to
the URL is stored in a single text column, this works absolutely fine
- The result stored in the single text column looks like this:
- To update the URL in my edit form I use a context variable which retrieves the URL from a ListBox control that mirrors the attachments of the list item. This means images must first be attached to the list item via the attachments control and can then be selected as main image.
I hope this clarifies things a little further. Thank you for your help.
The default Attachments column works best. It is easy to add and remove from and super easy to make that data display in the app. I usually put a gallery that list the attachments and have were they can View the attachment in the app and I put a button that allows them to download the attachment if that is needed.
See attached is just one example of how you can lay it out...tons of options though.
Thank you for your reply and your suggestions. Unfortunately I am required to give my clients the functionality to select a main image from their attachments.
In general, my solution works, it just does not work under certain conditions. I recently figured out, if I embed the PowerApp in a SharePoint site I do not have the authentication problems I described previously.
I don't know for certain this is your issue BUT when I do an app that is tied to a SharePoint Library I get a similar error and to avoid this I have a pretty simple Flow I build...I am thinking it is something similar you are needing. I would try and see if this is your solution. Look at this video and the Flow to do is about 11 minutes in:
Continue your learning in our online communities.
Next Wednesday, September 18th at 8am PDT
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Register by September 5 to save $200