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 & ")"
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):
What am I missing?
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
@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?
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
179 | |
45 | |
44 | |
34 | |
33 |
User | Count |
---|---|
255 | |
82 | |
78 | |
67 | |
65 |