Hello Power Apps Community,
Can you help please? I'm dreadful with variables, and need some assistance. This may get confusing.
In a nutshell I want to pass a record in a gallery to a form, but... I already pass a record from another gallery into that form.
Here's the long explanation.
I have a screen Screen Search Employee which has a gallery galEmployee.
For the OnSelect property of galEmployee I have the below formula.
Set(
gblEmployee,
ThisItem
);
Navigate('Screen Edit Employee');
ViewForm(frmEditEmployee)
So this passes the record of the selected Employee record in the Employee gallery galEmployee by using the global variable gblEmployee to the screen Screen Edit Employee, which holds a form called frmEditEmployee.
This is working perfectly. So I click an Employee record in the Employee gallery and on the other screen then details of that employee show on the form.
My request
I have another screen Screen Edit Company that has a form, which shows a Company record.
The Company table is the parent of the Employee table.
So 1 Company record can have many Employee records.
On this screen Screen Edit Company beneath the Company form I show all the related Employee records in a gallery galCompanyEmployee.
When a user clicks on a specific Employee record in the gallery, I pass them again to the Screen Edit Employee which holds the form called frmEditEmployee. So, the same as above.
I use this formula in the OnSelect property of a record in the gallery galCompanyEmployee:
Navigate('Screen Edit Employee');
ViewForm(frmEditEmployee);
But, when I'm landing on the form frmEditEmployee it is not showing the record I selected in the gallery galCompanyEmployee.
This, I think, is because I'm not passing/referencing a variable.
How can I call the global variable I already have gblEmployee? Or am I misunderstanding how global variables work.
Thanks very much,
Garry