cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vincent_I
Regular Visitor

Passing VarRecord from one SharePoint list to another SharePoint list

I am trying to pass a SharePoint list ID from one SharePoint list to another SharePoint list using VarRecord in Power Apps.  It works fine when I run the app in Power Apps.  See image and code below:

Text = "ADDITIONAL DESTINATION " & "- " & " (FTR ID: " & VarRecord.ID & ")"

Vincent_I_0-1633545730979.png

 

The problem is when I try to run this same function directly from the SharePoint list form, the VarRecord.ID is blank (see image below):

Vincent_I_1-1633545730979.png

What am I missing?

 

 

 

 

 

5 REPLIES 5
BCLS776
Super User
Super User

Can you check the location of the Set() function that is assigning the values of VarRecord? If it is in the OnStart property of the app, this does not always trigger properly when using a Sharepoint integrated form. If possible, move it into the OnVisible of the screen or another handy behavior property.

 

Hope this helps,

Bryan

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

I am new to Power Apps so I am not quite following you.  Currently in the gallery, I have "OnSelect = Set(varRecord, ThisItem)" and "OnVisible = " (blank).  
 
I tried to set "OnVisible = Set(varRecord, ThisItem)", but this function is not allowed.  I am getting an error message "Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app."


@Vincent_I wrote:
I am new to Power Apps so I am not quite following you.  Currently in the gallery, I have "OnSelect = Set(varRecord, ThisItem)" and "OnVisible = " (blank).  
 
I tried to set "OnVisible = Set(varRecord, ThisItem)", but this function is not allowed.  I am getting an error message "Incompatible type. We can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app."

The OnSelect property is a good place to set the varRecord variable; this means the variable will be set when the user clicks on that record in the gallery. You can examine this for yourself while in the development environment by selecting View-Variables to see the current value of varRecord.

ThisItem is a special reference that has context only within the gallery or form in which it exists. OnVisible is a property of the screen, which is outside the gallery, so Power Apps doesn't recognize ThisItem in that context.

 

Now, your variable varRecord does not get set unless the user selects the record in the gallery. When you run the app through Sharepoint, is the user able to do this action?

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

When the user selects a record in the gallery in PowerApps, it works as designed.  When the user selects a record through the SharePoint list (outside of PowerApps), it does not work.  


@iweb4ullc wrote:

When the user selects a record in the gallery in PowerApps, it works as designed.  When the user selects a record through the SharePoint list (outside of PowerApps), it does not work.  


Ok, this is an unusual use case I don't typically deal with in my work. It sounds like you are using an app that has both a Sharepoint integrated form and regular gallery/form combination in the same app? The reason your varRecord variable is not getting updated is that you are not entering that form through a click in a gallery that activates the OnSelect code for the gallery.

Or, are we differing on terminology somehow?

 

Your best bet might be to repost your question, explaining more about how your app is structured. Hopefully a user who has integrated an app this way will chime in with a response.

Bryan

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,371)