cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alderney
Helper III
Helper III

Date Picker issue patching and resetting gallery

Hello

I have two screens, one is where you start to type in a name and suggestions are populated in the drop down box.  After choosing the one you want, "Go" navigates to the second screen with the details in a gallery of the information for the name chosen.

As shown here in screen shot

date picker issue2.png

This is all working how I want it to.  However, when I go to the second screen and use the date picker, firstly it doesn't patch to my sharepoint list, though the tick box does and when you change the date, the information and name changes on the gallery, and I get a "title required" error code when I go out of the trial using the play button.  If I put a space in the coding and then remove it the error goes away?! (not in original when I add the coding either, only after I have trialled the app)

As per screenshot

date picker issue1.png

I have used the date picker function on another app without any problems, and this one has the same coding.  I added a save button to see if any different, same result.

 

Anyone have any ideas what's happening and why?

Thanks

31 REPLIES 31
WarrenBelz
Most Valuable Professional
Most Valuable Professional

@AsanKani ,

A bit more delving - I have never done it before, but in the "classic experience" in SharePoint apps, you can create a Contacts App and synchronise this with Outlook, however I created one and two things happened - I had a Title column, but the list was not visible to Power Apps, either Canvas or Integrated (the latter did not have an option to create). Like a few other "legacy" SharePoint facilities, it was around a long time before Power Apps and did not make the integration roadmap . . .

AJ_Z
Super User
Super User

Just checking have you already tried:

Patch('NZ Schools Contacts', Defaults('NZ Schools Contacts'),{Title:"","Date Visited":DatePicker1.SelectedDate})



Signature:


If you appreciated my comments/responses please be sure to Like/Kudo them it really does make me smile 🙂 !
Link to the Power Platform Professionals United Kingdom User Group:

https://powerusers.microsoft.com/t5/Power-Platform-Professionals/gh-p/PowerPlatformProfessionalsUnit...

@AsanKaniand @WarrenBelz 

I changed the last name column to Title which enabled me to patch the date, however on selection of the date it patches a new list item not patched to the list item in sharepoint already. It also still resets itself to the first named details on the drop down box.  I have set a search box which you start typing in the name and the names appear in alphabetical order in the dropdown box, selection is then made which opens up the details.  On this screen the date picker is.  Rather annoying issue, as you would have to go back to the original screen to go back into the one you're wanting with all the information.

so...one issue fixed hooray...

WarrenBelz
Most Valuable Professional
Most Valuable Professional

@Alderney ,

Is that a drop-down or combo box? The latter has the nasty habit of resetting to its DefaultSelectedItems when the screen is loaded, which may explain your issue. 

The SharePoint format depends on your site Regional Settings - I am surprised dd/mm/yyyy" - is not the Default . .

WarrenBelz_0-1633818307292.png

What are the Items of the combo box ? There is a method of displaying text with a date in a second column not displayed, but then choosing the date selected.

 

Hi Warren

I managed to change the regional settings so I could change the date.  It is a dropdown box not a combo one. So I am able to patch now but it creates a new list item not adding to the one selected, and still resetting. (Would the dropdown box in this instance perhaps the same issue as the combo?  in which case how do I change that setting?)

Screenshot of the dropdown settings

dropdown screen1.png

WarrenBelz
Most Valuable Professional
Most Valuable Professional

HI @Alderney ,

Firstly, if it is resetting, then set a Variable to the item chosen OnChange of the drop-down, then make the Default this Variable.

As well you code Defaults(ListName) will create a new record - I assume that is what you wanted to do. If you want to update an existing record, you need the ID of that record - in the example below, it is selected from a gallery (if you have done this)

Patch(
   'NZ Schools Contacts', 
   {ID: YourGalleryName.Selected.ID},
   {'Date Visited': DatePicker1.SelectedDate}
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

@WarrenBelzI'm wanting to update an existing record.  when I add the Id, it still asks for title, and it won't patch. when I add title part, it won't patch either, so seems only to patch new record at this point, with only the title part.

I'm not too familiar with variables, i'm not sure what i would put as default

 

WarrenBelz
Most Valuable Professional
Most Valuable Professional

@Alderney ,

I think we need to take a step back now I understand your relative experience with some of the concepts here. Firstly, how do you identify the record you want to Patch? I was assuming you selected it from a Gallery, but I do not see one in your screen shot of the tree. Also I did not know where you were with the Title field (you can make it non-compulsory so you do not have to Patch it). ID was two capital letters, so, does this work ?

Patch(
   'NZ Schools Contacts', 
   {ID: YourGalleryName.Selected.ID},
   {
      Title: " ",
      'Date Visited': DatePicker1.SelectedDate
   }
)

As for the Variable - what is the Items of the drop-down ?

@WarrenBelzI used your recommended patch and got the following error message

patch error.png

I agree I need to tell it where to patch to, my thoughts would be to the Full Name as given in the SP column that matches one of the populated input boxes as well as the drop down selection.  I tried that, pointing to an input box in the gallery, however, it would only patch a new record in the SP list, not to the existing SP record in the SP list, (if that makes sense). If I point it to the dropdown selection I get an error. would I need to use In function to get what I want?

 

The items of my dropdown are:

dropdown screen1.png

Thanks for your help Warren it is much appreciated

WarrenBelz
Most Valuable Professional
Most Valuable Professional

@Alderney ,

What is the Items of the gallery ? It needs to contain the ID for this to work that way. Otherwise, you could go down the track of this assuming 'Full Name' is a unique field.

UpdateIf(
   'NZ Schools Contacts', 
   'Full Name' = YourNameControlOutput,
   {
      Title: " ",
      'Date Visited': DatePicker1.SelectedDate
   }
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

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 (5,694)