cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
elevate-me
Helper I
Helper I

PowerApps Variable Error

Hello Everyone - I'm having an issue with my variable "Set(varItemParcel,ThisItem)" in PowerApps. The attached image is the error I'm getting. Now, I user variables quite often in my apps but this is the first time I'm seeing this. It works until I exit and reopens it to begin working again. Any thoughts of why this may be happening?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

@elevate-me ,

If you mean the Visible is varProjectItem, then that is your problem - you are setting it to a Boolean (true/false) in one place and a Record in the other. Just use a different name on one of them.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @elevate-me ,

Firstly, where are you using this when you get the error - I assume an icon in a Gallery.

WarrenBelz_0-1662190434291.png

 

Also the error suggests you have used it somewhere else in your app in a format other than a Record - are you able to locate this ?

Hello @WarrenBelz, I am using as the 'OnSelect' property of the gallery. The variable is being applied in two other galleries (Ex: Gallery A: OnSelect = Set(varProjectItem,ThisItem); Gallery B: Visible = ProjectItem; Gallery C: Visible = ProjectItem. No luck in finding the source of issue. I'm open to any suggestions.

@elevate-me ,

If you mean the Visible is varProjectItem, then that is your problem - you are setting it to a Boolean (true/false) in one place and a Record in the other. Just use a different name on one of them.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelz  Yes, that's what I mean. Okay, I think I get what you're saying. Create a separate variable for one of the galleries (i.e., Gallery A: OnSelect = Set(varProjectItem,ThisItem); Set(varProjectItem2,ThisItem); Gallery B: Visible = varProjectItem; Gallery C: Visible = varProjectItem2)?

Hi @elevate-me ,

No not quite - one for the Visible and one for the Record. You cannot set a Variable with different formats (Boolean & Record). You may need 4.

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,832)