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 / Dropdown list assign a...
Power Apps
Answered

Dropdown list assign a different value to each gallery item

(0) ShareShare
ReportReport
Posted on by 447

Hello,

 

I'm new to Powerapps and try to do something that is pretty complicated for me and about which i can't find any help on the net. Hope someone will have an idea..

 

So, I have a SharePoint list with a dropdown containing different timeframes.

What i need is for each time frame of my dropdow (7 timeframes) fill 3 field, so it's something like :

 

Timeframe      field1    field2     field3

2H                     1           1            3

4h                      2           3            4

8h                      1           5            2

etc....

 

This will have to save 7 lines (1 for each timeframe) to my list.

 

I managed to do something that saves several lines to a list using a gallery so my idea was to do the same but i don't understand how i can switch the values of the time frame over the lines and and limit this number to 7.

I also thought i could use a text field instead of a dropdown so i will push predefined values to my list but then the problem is how can i switch the values in the text field..

 

I hope this is clear enough and someone will be able to help me with this.

 

Thanks a lot !

 

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

    Hi @Kadd ,

    Could you please share a bit more about the "Timeframe" field in your SP List? Is it a Choice type column?

    Do you want to fill three fields for each timeframe value (2h, 4h, 8h ...) within your SP list?

     

    Based on the needs that you mentioned, I think the Gallery control could achieve your needs. You could consider create a Blank Gallery, set the Items property to following:

    Choices('Your SP List'.Timeframe)

    Then within the Gallery, add a Label (called "Title2"), set the Text property to following:

    ThisItem.Value

    then add three TextInput Boxes within this Gallery (for each one of these 3 fields).

    8.JPG

     

    9.JPG

     

    Then add a "Submit" button outside the Gallery, set the OnSelect property to following:

    ForAll(
     Gallery1.AllItems,
     Patch(
     'Your SP List',
     Defaults('Your SP List'),
     {
     Title: "xxxxx",
     Timeframe: {
     Value: Title2.Text // Title2 represents the Label in above Gallery
     },
     Field1: TextInput1.Text,
     Field2: TextInput2.Text,
     Field3: TextInput3.Text
     }
     )
    )

    Note: I assume that the Timeframe field is a Choice type field in your SP List.

     

    Within above Gallery, you could provide proper values for these three fields in each Timeframe item, then click "Submit" button, then these Gallery items would be saved back to your SP List.

     

    Patch function and ForAll function

     

    Best regards,

  • Kadd Profile Picture
    447 on at

    Hello @v-xida-msft ,

     

    thanks a lot for your reply.

     

    Yes, in my list the Timeframe field is a choice.

    Waw...that exactly does what i'm looking for !! Thanks a lot !!! 🙂

     

    (I know it's not too nice right now but i'm still testing ... 😛 )

    actimp.png

    Bottom right of the form is what it gives me. the 3 fields are "Financial", "Reputational","Legal" which I also have in my SP List so values are copied....

    list.png

     

    and i readapted the formula like this (in the onSelect property of my save icon)

    ForAll(
     Gallery7.AllItems,
     Patch(
     Impact,
     Defaults(Impact),
     {
     Title: "xxxxx",
     Timeframe: {
     Value: Label8.Text
     },
     Financial: Value(TextInput8.Text),
     Reputational: Value(TextInput9.Text),
     Legal: Value(TextInput10.Text)
     }
     )
    )

     

    Now i have to add this formula to my form's save button and finish a few things on the form.

     

    That's really cool !!

     

    Thanks a lot !!!

     

     

  • Kadd Profile Picture
    447 on at

    Hi @v-xida-msft ,

     

    Can i just come back for a second...

     

    In fact it almost works cause the problem i have is since i set the Item property of the gallery with  Choices(Impact.Timeframe) , It saves to the list but i can't show the values back into my gallery.

     

    So back to my screenshots, when i select an item in the gallery at the bottom left (Activity) it should show the corresponding items with their timeframe. So I have a hidden field that allows me to filter the gallery at the right(Impact) depending on the selection in the Activity gallery. But I can't do that ... 😛

     

    so i readapted the formula in my "Impact" gallery this way 

     

    Filter(Choices(Impact.Timeframe),TextInput4.Text=Gallery5.Selected.Act) 

     

    where TextInput4 is the is the activity field that i use as a primary key. that doesn't show any error but it doesn't work and i can't get the values back in "Financial","Reputational","Legal".

     

    So to be clear here the issue is, i can push the values of my fields to my list (following your answer) but i can't show the values of my list related to a selection in a first gallery.

     

    Would you have any other idea for this ?

     

    Thanks!!

     

     

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard