cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
danielf1
Helper I
Helper I

Power App - Same value gets added on all rows

Hello guys,

 

I m a novice , just started out with PowerApps 2 weeks ago and i am currently working on a desk reservation system.

 

The desk select page contains a gallery which pulls the desk info from a SharePoint list  called Desks and for each desk i have a checkbox next to it which adds the item to the collection OnCheck property and adds it to the collection.

 

danielf1_0-1625137782229.pngdanielf1_1-1625137801739.png

 

I want to also add the person that will use that desk for on behalf of type of reservations but the issue that i am facing is the following:

I had the dropdown with my name on it inserted in the gallery but once i select a value in the 1st field, the same value gets added to all desks ( obviously and understandably i understand why it does that) but is there a way to add different values to each field without manually adding dropdowns for each desk ( which the number of can be dynamic) ?

 

 

thanks for the help

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
JamesYumnam
Resolver III
Resolver III

@danielf1 

updated few things. Please follow the following:

  1. this is how the design looks: Pencil = Selected desk (Label6), CheckBox (Checkbox1)and the dropdown control(Dropdown3)
    JamesYumnam_1-1625235055558.png

     

  2. In the Checkbox control, - OnCheck(), write the following code:
    Collect(selectedDesks,{SelectedAgent:Dropdown3.SelectedText.Value, DeskNumber:Label6.Text})
    Here we are adding the columns SelectedAgent and DeskNumber into the collection manually.
  3. In the Patch(), update the code with the follwing:
    ForAll(selectedDesks,
    Patch(DataEntryFromPowerApp,Defaults(DataEntryFromPowerApp),{Agent:ThisRecord.SelectedAgent,Title:ThisRecord.DeskNumber}))

Test

Input:

JamesYumnam_2-1625235338089.png

 

Ouput (in SP list):

JamesYumnam_4-1625235399012.png

 

Please try and let me know if it worked!

 

 

View solution in original post

25 REPLIES 25
BCBuizer
Super User
Super User

You could move the dropdown into the gallery so you can set the Person per Item.

BrianS
Super User
Super User

What if you replace the checkbox with the dropdown of people's names. Then in the OnChange property add that desk to the collection with the name. 

Hello Brian,

 

Thanks for the reply, but if i do that wont all the desks be selected by default since they will have a person in them?

Hello @BCBuizer ,

 

Thanks for the reply, can you please tell me where i should modify that property as i can t find it.

BCBuizer
Super User
Super User

Hi @danielf1 ,

 

Select and copy the dropdown. Then select the top item of your gallery and paste the dropdown in there. This will automatically replicate the dropdown in the below items so you can set the value per item.

Oh,i got that from the start,hence the issue

danielf1_0-1625141931143.png

 

danielf1_1-1625141941354.png

 

 

 

 

danielf1_2-1625141995970.png

 

as it takes only one value, am i doing something wrong?

danielf1
Helper I
Helper I

any ideas?

JamesYumnam
Resolver III
Resolver III

I am assuming Agents is the table name. Are there more records in this table other than your name? If yes, can you see all the Titles listed in the dropdown?

Hey James,

 

So i have 3 lists, one containing desks , one containing the reservations and one containing the people.(and a collection with all the details that are inserted in the reservations lists)

 

Agents is the list that contains the people, yes. Currently for testing i have just my name Danniel,Daniel1,Daniel2. Yes i can see all of them.

danielf1_0-1625211316063.png

 

 

What i am trying to do is to add separate names / desk 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,260)