web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Help with Modern Date ...
Power Apps
Answered

Help with Modern Date Picker In Edit Mode

(0) ShareShare
ReportReport
Posted on by 232

Hello All,

 

I need some direction but first here is my setup in my app that I believe is relavent to my situtation.

 

Sharepoint:

Columns = single line of text

 

Collection: colDays

 

 

ClearCollect(
 colDays,
 {
 Value: "Sunday",
 ID: 1
 },
 {
 Value: "Monday",
 ID: 2
 },
 {
 Value: "Tuesday",
 ID: 3
 },
 {
 Value: "Wednesday",
 ID: 4
 },
 {
 Value: "Thursday",
 ID: 5
 },
 {
 Value: "Friday",
 ID: 6
 },
 {
 Value: "Saturday",
 ID: 7
 }
);

 

 

Form:

DataSource: Sharepoint

DefaultMode: Edit

Items: 

 

Gallery.Selected

 

 

Gallery:

Items: 

 

Filter(Sharepoint,'Created by' = User().Email)

 

 

DataCard:

Default: 

 

ThisItem.ColumnName

 

Update: 

 

ComboBox.Selected.Value

 

Multiselect.Combobox:

OnSelect:

 

Set(VarMeetDaysChanged, true)

 

Items: 

 

colDays

 

DefaultSelectedItems: 

 

Split(Parent.Default, ", ")

 

 

Modern Date Picker:

OnChange:

 

If(
 !(Weekday(Self.SelectedDate) in ComboBox.SelectedItems.ID),
 Notify(
 "Date does not match Activity Meeting Days.",
 NotificationType.Error,
 3000
 ) & Reset(Self)
)

 

 

I have a Combobox that is Multiselect with each day of the week as an option. This is sent to my Sharepoint which is setup as single line text. My submitting the form is not an issue. When the form is in edit mode the user might need to update the Weekdays selected. If they do this then the way the formula is setup it should only allow them to select dates that equal the weekdays they selected in the Multiselect.Combobox. This is not happening. When I use the Modern Date Picker it does not allow any days to be selected. I have narrowed it down to the defaultselecteditems on the Combobox is not truely registering the days selected. They show in the top of the drop down field but as you can see in the picture below they are not actually selected. I also selected another weekday and my rule worked.

Screenshot 2023-10-18 210841.pngDoes anyone see what I could do to fix this? Maybe some formula I am missing? I thought about making the Multiselect.Combobox into checkboxes and I kept getting lost on this.

 

As always any help will be greatly apprciated.

 

Thanks,

 

Collin

Categories:
I have the same question (0)
  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @collinktx ,

     

    Please try this:

    Modify the formula on the DefaultSelectedItems of multiselect combo box:

    ForAll(Split(Parent.Default, ", ") As C,LookUp(colDays,Value=C.Value))

     

    Best regards,

    Rimmon Li

  • collinktx Profile Picture
    232 on at

    Hi @v-mengmli-msft ,

     

    I accidentally hit the thumbs up. so I put that in and it cleared the selections that were showing. Let me take a screenshot.

  • collinktx Profile Picture
    232 on at

    @v-mengmli-msft 

     

    With my DefaultSelectedItems setting as

    Split(Parenet.Default, ", ")

     You can see Monday and Wednesday showing as a default and you see a Monday and Wednesday Combobox showing time. This shows that both are partically working. They work for my Visiblitiy property.

    Screenshot 2023-10-19 014411.png

     

     

     

     

     

     

     

     

    After running with your formula

    ForAll(Split(Parent.Default, ", ") As C,LookUp(colDays,Value=C.Value))

    Screenshot 2023-10-19 014133.pngScreenshot 2023-10-19 015239.png 

     

    With your formula it cleard the selections from the top of the combobox but my Monday Time Combobox is showing so that is like it is still registering a visible property to be true.

     

    Hope this helps in a next step.

     

    Thanks,

     

    Collin

     

     

     

  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @collinktx ,

     

    Place your mouse over this formula to see the returned result.

    vmengmlimsft_0-1697698965744.png

    If it is correct, try cutting the formula and repasting.

     

    Best regards,

    Rimmon Li

  • collinktx Profile Picture
    232 on at

    @v-mengmli-msft ,

     

    Thank you very much again. So I think something was getting stuck. My form loads as view and then I click a button to edit it. After I did that and submitted the update to my sharepoint everything was working. 

     

    And just to see how much of this I understand...

     

    I get that the Split makes like a table I believe for my defaultselecteditems, does the ForAll combine them somehow to be received by the combobox? I understand what lookup does but what does "As C" do? I have never seen that before.

     

    Thank you again. That is two nights you have helped me. You got a speed dial? lol

    Have a good one.

     

    Thanks,

    Collin

  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @collinktx ,

     

    You can understand that each record in the table is temporarily marked as C, C has the data of this record, for example, you want to get a certain value of this record you can do this: C.ColumnName, C can also be the name of any other record used to mark, such as ForAll( Table As CC , ...  ), ForAll( Table As BB , ...  ),etc.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard