cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
audrieg
Level 10

set screen background image

How do you set the screen background image to an image in a sharepoint list where the ID =1

 

I have a Sharepoint list connection (List name PhotoLinks). It has a hyperlink column (URLLink) formatted as a picture. I'd like to use it as my apps background image. I tried doing what I typed below here - but I keep getting an error message. Can you help fix my expression please?

 

From the Screen1

Background Image Property

 

PhotoLinks.URLLink(ID in "1")

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
mr-dang
Level 10

Re: set screen background image

Oh, I know what it is this time. It's the parentheses

First(

Filter(PhotoLinks, ID=1)

).URLLink

Filter(PhotoLinks, ID=1) pulls up all records in PhotoLinks in which the ID=1.

 

First() picks the first one of that subset.

 

URLLink needs to be after the parentheses for First are closed. Then it will pull up the contents of the URLLink column for that first record.

 

Here it is collapsed:

First(Filter(PhotoLinks, ID=1)).URLLink
Microsoft Employee
@8bitclassroom

View solution in original post

PowerApps Staff aftowen
PowerApps Staff

Re: set screen background image

As a short-term fix, you could just upload the image to the app itself.

  1. Download the image that you want to your local computer.
  2. In PowerApps, click the Content tab, and then click Media.
  3. In the upper-right corner, click Browse.
  4. Navigate to the image you want, click it, and then click Open.
  5. In the upper-left corner, click the Back arrow, and then set the Background image property of the screen to the file name of the image that you want.

View solution in original post

19 REPLIES 19
mr-dang
Level 10

Re: set screen background image

There are two ways to get to it--either a LookUp or a Filter. LookUp pulls up the first qualifying record. Filter can pull up more than one, but you can use First to get the first one.

 

For individual Image box:

 

 

LookUp(PhotoLinks,ID="1",URLLink)

or

First(Filter(PhotoLinks,ID="1")).URLLink

 

If the Image box is in a gallery whose Item property is already set to PhotoLinks:

ThisItem.URLLink

 

Microsoft Employee
@8bitclassroom
audrieg
Level 10

Re: set screen background image

I tried it on screen 1 but got the following info message.

"The values being compared have mismatched types (left is Number and right is Text). Please check for logical and syntactic errors, and use parentheses to provide explicit logical grouping."  (which sounds a bit like greek to me - lol) So I added a parenthesis to the end, and to that it said "unexpected token".

 

Screen shot below.

 

Unfortunately neither option worked.

 

backgroundscreen1.png

 

 

 lookup.png

 

 

 

I hope I mentioned that this is not for an image gallery, rather it's for the screens.

mr-dang
Level 10

Re: set screen background image

Oh, that's an easy fix. The blue warning icon just means that the things you are trying to compare are different types. Numeric values, text, and boolean (true/false) cannot be compared to one another until you change both sides to be the same type.

 

All you need to know in the error is the part that says "left is Number and right is Text." The ID column in your table (left side of the comparison) was set to numberic values, but "1" the thing you want to compare it against (right side) is text becaus we wrapped it around quotation marks.

 

To fix it, remove the quotation marks around 1, and it will change from text to the value of 1.

 

 

Microsoft Employee
@8bitclassroom
audrieg
Level 10

Re: set screen background image

So, I didn't know you wanted me to 'read' those error messages (smiles). I would probably post less if I read more... 🙂

 

I really appreciate your patience on this post. I tried removing the quotes which lead to another error (shown screen shot).

 

Screenshot1.PNG

 

In that URLLink column on SharePoint there is an image URL formatted as a picture. Is that ok?

 

Audrie

audrieg
Level 10

Re: set screen background image

If there is a way to upload a background image, I'm ok with that too.

mr-dang
Level 10

Re: set screen background image

Oh, I know what it is this time. It's the parentheses

First(

Filter(PhotoLinks, ID=1)

).URLLink

Filter(PhotoLinks, ID=1) pulls up all records in PhotoLinks in which the ID=1.

 

First() picks the first one of that subset.

 

URLLink needs to be after the parentheses for First are closed. Then it will pull up the contents of the URLLink column for that first record.

 

Here it is collapsed:

First(Filter(PhotoLinks, ID=1)).URLLink
Microsoft Employee
@8bitclassroom

View solution in original post

audrieg
Level 10

Re: set screen background image

I was all excited that all the error messages are gone now after fixing the parenthesis....but the background still doesn't show the photo (png). I feel bad to keep bothering you on this, but what might cause the background to resist the image? Are there sizing constraints maybe? I removed all values from the background fill property to ensure no conflict...but now it's just white.

 

thank you again!

Steelman70
Level 10

Re: set screen background image

Hi Audrie, can I suggest a test to see if the problem is the reference to the list or for example permissions to the image etc.

 

Can you try to set the Screen1.BackgroundImage to this: "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" and see if you get the Google logo in background?

 

If this works, then try to change the BackgroundImage property back to First(Filter(PhotoLinks, ID=1)).URLLink or even to this LookUp(Photolinks, ID=1).URLLink and change the URL of ID 1 in your SP list to the Google logo and see if that works.

 

If this last step works then the issue is with your image and not with PowerApps

 

Please let me know how you get on

 

CaptureBackground.PNG

mr-dang
Level 10

Re: set screen background image

A few more tests to try after @Steelman70's suggestion--

  1. Refresh the datasource. PA might have a communication error with the data source.
  2. Save the app and reopen it.
  3. Create a textbox. Set its Text property to Screen1.BackgroundImage. It should reveal the URL you have set. Copy paste the result into a browser to find out what it is or should be.
  4. Last one--it could be that the URL has been blocked. I host my images on Google Drive and when I go to Starbucks, it blocks the images.
Microsoft Employee
@8bitclassroom

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 317 members 5,316 guests
Please welcome our newest community members: