
Announcements
I am designing medical records application and need help in gallery and forms designing.
Context:
Gallery 1 and Gallery 2 and Gallery 3 and all Forms on 3 screens are connected to CustomerMedicalRecord Data table.
Screen 1: Gallery 1 shows Family Medical Record Numbers. OVERALL FAMILY HISTORY Form shows Gallery 1 selected record details.
Screen 2: Gallery 2 shows individual family members names. Family Member Detail form shows Gallery 2 selected family member record.
Screen 3: Gallery 3 with family member names
I want:
Example: User click on pen icon in OVERALL FAMILY HISTORY FORM Family Member 2 on screen 1.
Now, User should be navigated to screen 2 and Gallery 2 should show Family Member 2 Name and on right hand side Family Member Details form should automatically populate with family member 2 details.
2. I also want to allow user to select any family member name in Gallery 3 and user should be navigated to screen 2 and gallery 2 on screen 2 should show selected family member name from gallery 3 and family member details form on screen 2 should show selected family member details.
3. I also want to allow user to use search box on screen 2 to select any family member based on their family member name or number.
4. On Screen 2 - By default all member records are listed in gallery 2 so user can select any record on gallery 2 and family member form on screen 2 should auto-fill details for selected member name.
Sharing Screen1, Screen 2, Screen 3 - snapshot for your reference.
Any help on code snippet or guidance on how to get screen 2 gallery and form show selected family member name from screen 1. And also how to get screen 2 form and gallery to show same member details when user select member record in screen 3.
The following are a few examples of how you should be able to achieve these actions in Power Apps using Power Fx.
Please modify them to suit your particular needs, taking into consideration the specific column names in your database and other details in your app.
Requirement 1
To make the icon on screen 1 navigate to screen 2 and populate the details in Gallery 2 and the form, you can use the Navigate function and Set global variable function.
In the formula for the OnSelect property of the pen icon in Screen 1, you could use:
Set(gloSelectedMember, ThisItem); Navigate(Screen2, ScreenTransition.None)
Then, in the Items property of Gallery 2 on Screen 2, you can reference the global variable:
Filter(CustomerMedicalRecord, FamilyMemberName = gloSelectedMember.FamilyMemberName)
For the form's Item property on Screen 2, you should also use:
gloSelectedMember
Requirement 2
To allow the user to select any family member name in Gallery 3 and navigate to screen 2, you can use the OnSelect property of Gallery 3:
Set(gloSelectedMember, ThisItem); Navigate(Screen2, ScreenTransition.None)
Again, Gallery 2 and the form on Screen 2 should use the same formulas as mentioned in requirement 1.
Requirement 3
To let the user search for a family member in the search box on Screen 2,
you can modify the Items property of Gallery 2:
Filter(CustomerMedicalRecord, StartsWith(FamilyMemberName, TextInput1.Text) || StartsWith(FamilyMemberNumber, TextInput1.Text))
Where TextInput1 is the name of your search box control.
Requirement 4
To show all the member records in Gallery 2 by default, and display the details for the selected member in the form, you can set the Items property of Gallery 2 to CustomerMedicalRecord and use the OnSelect property to set a global variable that can be used by the form:
OnSelect property of Gallery that has your members:
Set(gloSelectedMember, ThisItem)
For the form's Item property on Screen 2, use:
gloSelectedMember
This is just a guide. The specific names of your controls, screens, and column names in your data source may vary. Remember to use the correct column names and control names that match your specific app's configuration.
The formula snippets should be set to the corresponding properties of your app's controls.
Remember to replace FamilyMemberName and FamilyMemberNumber with the actual column names from your data source.
See if it helps @BradAugustene