cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
venka91
Super User
Super User

Unable to Set ThisItem in variable

Hello Friends,

 

i am running out of an issue.

I do not why i am unable to set a gallery Record into a Variable. I am getting an error and no clues where it is wrong. I have been using this option many apps. But worked flawlessly. But why here it is failing.

 

venka91_0-1647673909212.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
venka91
Super User
Super User

I went code by code and the problem is because, i also wanted to Set the Result of Patch to a Variable, to update the comments by Helpdesk Agent and user so they can see the history in the ticket.

This was conflicting as i used two different screens to view the ticket for All Tickets, and Agent assigned tickets on another screen. Since the variable got the same name, and Form also set with Reset Property, ThisItem was not stored in variable when conflicts occurs.

 

Thanks for the support provided.

View solution in original post

4 REPLIES 4
gabibalaban
Dual Super User
Dual Super User

@venka91 ,

Are you sure that you use the formula in a behavior property like OnSelect? It seems to me that you used this on property that expect a boolean value (like visible).

Yes, I used it on OnSelect Property of an icon.

 

venka91_0-1647678050962.png

 

 

 

venka91
Super User
Super User

Hi there,

I using varGalRecord to set my current record in two galleries.

I have two screens 

1. View_AllTicket

2.View_myTicket

 

These two screens having gallery namely gallery_viewall, gallery_viewmy

On Select Property of these two galleries, i am writing as

Set(varGalRecord, ThisItem) to define the currently selected Record from the gallery.

 

But what happening is : from gallery_viewall, this works properly. Whatever ticket id i choose, the record correctly set varGalRecord, and displaying the details in the form.

In the Item property of my Form i have given varGalRecord so it displays the Record choosen in gallery_viewall

 

But in my View_myticket screen, on gallery_viewmy also though i have the formula set as Set(varGalRecord, ThisItem), this is not setting the record chosen from the gallery_viewmy . My form is still showing the record, which was chosen in gallery_viewall.

 

Why this Variable is not setting the record, when i use two different gallery.

 

venka91
Super User
Super User

I went code by code and the problem is because, i also wanted to Set the Result of Patch to a Variable, to update the comments by Helpdesk Agent and user so they can see the history in the ticket.

This was conflicting as i used two different screens to view the ticket for All Tickets, and Agent assigned tickets on another screen. Since the variable got the same name, and Form also set with Reset Property, ThisItem was not stored in variable when conflicts occurs.

 

Thanks for the support provided.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,764)