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 Apps
Answered

Dropdown selection

(0) ShareShare
ReportReport
Posted on by 100

Hi,

I have 2 datepickers and dropdowns in gallery and one dropdown outside the gallery. Now, I want to assign trainers based on dates as shown in the screenshot. User will select To and From Date from the datepickers and trainer from the dropdown(outside the gallery) now  for all the dates matched all the dropdowns inside the gallery should change to the selected trainer.

Note:Dropdown6 is outside the gallery
         Dropdown4 is inside the gallery
I have given default as dropdown6.selected.name for all the dropdowns inside the gallery.Screenshot (77).png

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

    Hi @sindhureddy :

    Could you please tell me what your requirement/question is?

    Could you please show more details about your app?

    Best Regards,

    Bof

  • sindhureddy Profile Picture
    100 on at

    Hello @v-bofeng-msft ,
    My requirement is I want to assign trainers for all the dates in the gallery. So, In case I want to assign 2 trainers for 1 month(first 15 days as 1 trainer and 2nd 15 days as another trainer) instead of selecting each dropdown from gallery and assigning them I have included one dropdown outside the gallery and datepickers.

    Now, I want to assign "Aparna" from 8/9/2021 to 8/13/2021, I will choose "From" and "To" Dates from the datepickers and select the trainer from the dropdown(outside the gallery) as"Aparna". Now only dropdowns from 8/9/ to 8/13 (inside the gallery ) should change to "Aparna".

    Based on the dates I choose, Dropdowns for that dates should be changed rest should not change.

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

    Hi @sindhureddy :

    You could set the Dropdown4's Default property to:

    If(
     Thisitem.'Scheduled Dates'>=FromDatePicker.selected.date &&
     Thisitem.'Scheduled Dates'<=ToDatePicker.selected.date,
     dropdown6.selected.name
    )

    Best Regards,

    Bof

  • sindhureddy Profile Picture
    100 on at

    Hi @v-bofeng-msft 

    Above formula is working for me, Now how can I implement the same in re-assigning the trainer bcoz, Dropdown4's Default property in re-assign I have Thisitem.TrainerName.
    So how can we write both formula's in default property?Can you please help me with this.



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

    Hi @sindhureddy :

    Please try:

    If(
     Thisitem.'Scheduled Dates'>=FromDatePicker.selected.date &&
     Thisitem.'Scheduled Dates'<=ToDatePicker.selected.date,
     dropdown6.selected.name,
     Thisitem.TrainerName
    )

    Best Regards,

    Bof

  • sindhureddy Profile Picture
    100 on at

    @v-bofeng-msft 

    Yes tried with this formula but this will change only 1 trainer. But If I want to change the 2nd trainer for other dates then how can we implement that.

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

    Hi @sindhureddy :

    1\Set the Update button's OnSelelct property to:

    Collect(
     TheCollection,
     {
     From:FromDatePicker.selected.date,
     To:ToDatePicker.selected.date,
     Name:dropdown6.selected.name
     }
    )
    

    2\ Set the Dropdown4's Default property to:

    With(
     {TheResult:Lookup(TheCollection,Thisitem.'Scheduled Dates'>=From && Thisitem.'Scheduled Dates'<=To)},
     If(
     IsBlank(TheResult),
     Thisitem.TrainerName,
     TheResult.Name
     )
    )

    Best Regards,

    Bof

  • sindhureddy Profile Picture
    100 on at

    @v-bofeng-msft Thanks for the reply
    But I did'nt get why should we use update button onselect property here.
    Bcoz my requirement is - In gallery I have 30 dates where 1st 15 dates(i.e., 8/01/2021 to 8/15/2021)  is assigned to "Ramya" and 2nd 15 dates(i.e., 8/16/2021 to 8/30/2021) is to "Mounika" now in this Re-assign trainer screen I want to change "Ramya" to "Preethi" and "Mounika" to "Sindhu".

    From the below formula we can only change single trainer at a time. I want to change both trainers and then update them.

    If(
     Thisitem.'Scheduled Dates'>=FromDatePicker.selected.date &&
     Thisitem.'Scheduled Dates'<=ToDatePicker.selected.date,
     dropdown6.selected.name,
     Thisitem.TrainerName
    )



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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,041

#2
11manish Profile Picture

11manish 676

#3
Valantis Profile Picture

Valantis 655

Last 30 days Overall leaderboard