cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
trishmalloy
Post Prodigy
Post Prodigy

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?

11 REPLIES 11
Jeff_Thorpe
Super User
Super User

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.
v-xida-msft
Community Support
Community Support

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.

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.

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

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.

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.  🙂

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.

@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

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.

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

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!      

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Top Solution Authors
Top Kudoed Authors
Users online (4,299)