cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
trishmalloy
Level: Powered On

Need help with formula to display Client Name and Date of Workout in Gallery

Hello,

 

My app has 5 screens:

 

1. Search for client name

Navigate('Listing of Client Names', ScreenTransition.None)

 

2. List of Clients

Search('List of Clients','Search for Client'.Text, "Title")

 

3. Client Profile and List of Workouts (Screen split in 2 with a) View of Client Profile and b) List of submitted workouts for that particular client and the ability to edit client profile and add a new workout for that particular client.  See screenshot #3.

 

Formula for adding a new workout: NewForm(Form2);Navigate('Edit Client Workout', ScreenTransition.None)

*The Edit Client Workout screen is divided in 2 forms, the top view form pulls in the selected client's name (Gallery2.Selected) and the bottom form is a blank/new Form2.

 

Formula for editing client profile: EditForm(Form1);Navigate('Edit Client Profile', ScreenTransition.None)

 

4. Edit Client Workout

Formula for saving client workout:  SubmitForm(Form2);Navigate('Client Profile and List of Workouts', ScreenTransition.None)

 

5. Edit Client Profile

6. View Client Workout

 

When I add a new Client Workout the Name and Date are not showing up on Screen 3 Gallery, "Client Profile List of Workouts".  Can you help me figure out what I need to change in the formula?

10 REPLIES 10
Super User
Super User

Re: Need help with formula to display Client Name and Date of Workout in Gallery

What is the formula for the Screen 3 Gallery Items?

 

I am not sure how Items is configure on the screen 3 gallery, so I am taking a shot in the dark. Try adding Refresh('DataSourceName') to the OnSuccess of Form2.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: Need help with formula to display Client Name and Date of Workout in Gallery

Hi @trishmalloy ,

Which control do you use to list your workouts for that particular client in your 'Client Profile and List of Workouts' screen? Using Gallery?

In your step 4, please modify your formula as below:

SubmitForm(Form2);
Refresh('Client Profile List of Workouts data source'); /* <-- Add this formula */
Navigate('Client Profile and List of Workouts', ScreenTransition.None)

Note: The 'Client Profile List of Workouts data source' represents the data source the Gallery connects to in your 'Client Profile and List of Workouts' screen.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
trishmalloy
Level: Powered On

Re: Need help with formula to display Client Name and Date of Workout in Gallery

Hi @Jeff_Thorpe ,

 

Thank you for responding!  Here is the formula for Screen 3 Gallery Items:  Filter('Create Workout - Set 1','Client Name'.Id=Gallery2.Selected.ID)

 

More information that I should have added to begin with, there are 2 SP lists associated to this app:  1) Clients and 2) Workouts, when a new workout is created the client name auto populates but I noticed the name is not being created in the Workouts list when I save the record, but the workout data is being saved to the SP list..  This is probably part of the problem.

trishmalloy
Level: Powered On

Re: Need help with formula to display Client Name and Date of Workout in Gallery

Hello @v-xida-msft ,

 

Thank you for the reply!  I should have mentioned there are 2 SP lists behind this app, 1) Clients and 2) Workouts.  When I create a new workout (search for client, select client ... from the Client Profile and List of Workouts screen the client name is auto populated.  A record in SP is created but without the client name.  The Gallery (of workouts from screen 3) of course isn't displaying the name.  

 

Your help is appreciated!

Trish

Community Support Team
Community Support Team

Re: Need help with formula to display Client Name and Date of Workout in Gallery

Hi @trishmalloy ,

Could you please share a bit more about your scenario?

Is the 'Client Name' column a LookUp column in your 'Create Workout - Set 1' SP List?

 

Please check if you have selected a proper Client Name when you created a new Workout record in your Form2. If the 'Client Name' column is a LookUp column in your 'Create Workout - Set 1' SP List, when you created a new Workout record, you must specify the Client Name of it.

 

Please set the Items property of the Gallery in Screen3 to following:

Filter(
'Create Workout - Set 1',
'Client Name'.Value = Gallery2.Selected.ReferencedColumn
)

Note: I assume that the 'Client Name' column in  'Create Workout - Set 1' references values from the ReferencedColumn in your 'List of Clients' SP List.

Within the Gallery in Screen3, add a Label, set the Text property to following:

ThisItem.'Client Name'.Value

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
trishmalloy
Level: Powered On

Re: Need help with formula to display Client Name and Date of Workout in Gallery

Thank you @v-xida-msft for your help!

 

Client Name is the Title field renamed to Client Name in the Clients SP list.  Maybe this will help.

 

 - Screen 1: Search for client (Type in name e.g Trish, click magnifying glass), navigate to Screen 2

Navigate('Listing of Client Names', ScreenTransition.None);Reset('Search for Client');Refresh('List of Clients')

 

 - Screen 2 - Anyone with name of Trish shows up in Gallery, click right arrow next to correct Trish selection

Search('List of Clients','Search for Client'.Text, "Title")

Navigate('Client Profile and List of Workouts', ScreenTransition.None)

 

 - Screen 3 is populated with 2 forms, a) Client Profile - Gallery2.Selected and b) List of that client's workouts - 

Filter('Create Workout - Set 1','Client Name'.Value=Gallery2.Selected.'Client Name')

 

 - Screen 3 has a + button to add a new client workout, if clicked,  navigate to ... Screen 5 "Edit Client Workout" = Form2 

Form2 is auto-populated with client name through Items property "Gallery2.selected" formula. 

 

Screen 5 has 2 forms on it, the one for the client name (FormViewer2) and the second one for new workout fields

NewForm(Form2);Navigate('Edit Client Workout', ScreenTransition.None)

 

This is the formula associated to the save button on Screen 5

SubmitForm(Form2);Refresh('Create Workout - Set 1_3');Navigate('Client Profile and List of Workouts', Transition.None)

 

This is already set up the way you explained ... probably from help you gave me.  Smiley Happy

Within the Gallery in Screen3, add a Label, set the Text property to following:

 

I tried this but the client names are still not showing up in the list of client workouts in the SP list and on the list of associated workouts to each client.

trishmalloy
Level: Powered On

Re: Need help with formula to display Client Name and Date of Workout in Gallery

@v-xida-msft , @Jeff_Thorpe  - Can you offer any more assistance on this?  The main issue I'm trying to resolve is getting the Client Name (which is on a separate list) to populate in the SharePoint list when a new workout is created.

 

Quick overview of how process works:

- Search for client

- Select client

- Create new workout for client (Client's name shows up here from a view form at the top of the screen, the bottom of the screen in the new workout (edit) form.

- Submit new workout to SP list

Super User
Super User

Re: Need help with formula to display Client Name and Date of Workout in Gallery

Form2 has a datacard with a datacardvalue control for the client name? When you SubForm(Form2) it should save all the values that have a datacard on form2. If the client name is being submitted then it isn't on Form2 or the datacard isn't getting the value from datacardvalue control.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
trishmalloy
Level: Powered On

Re: Need help with formula to display Client Name and Date of Workout in Gallery

You are correct, the client name isn't on Form2.

 

On the Edit Workout screen there are 2 forms:

 

FormViewer2 which just displays the client name of the selected client (Search for client name, select client name, click + to create new workout for selected client)

 

Form2 is the new workout form.

 

This is the formula I'm using to submit the new workout form.  I feel like maybe there needs to be a patch function some where...?  Maybe ...

 

SubmitForm(Form2);Refresh('Create Workout - Set 1_3');Navigate('Client Profile and List of Workouts', Transition.None)

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 239 members 5,052 guests
Please welcome our newest community members: