Hi there,
I have a reservations canvas app, whereby the user selects checkboxes to reserve desks, and this patches to a collection called "col_booking". The items in this collection are displayed in a gallery, as a sort of shopping cart as the user selects what they want to reserve.
I now want to patch this to Dataverse, based on what they have selected, which would be displaying in the gallery.
My current patch code:
Patch(
Reservations, Defaults(Reservations),
{'Booking - Area': Dropdown2.Selected.Value},
{'Booking - Availability Status': "Reserved"},
{'Booking - Booked By': User().FullName},
{'Booking - Booked For': Dropdown6.Selected.Value},
{'Booking - Reservation Date': dp1.SelectedDate},
{'Booking - Bank Identifier': ""},
{'Booking - Booked by Email': User().Email},
{'Booking - Notify Addresses': Text(ComboBox1.Selected.Mail)},
{'Desk Reference': ""})
What I want to do is, for the "Bank Identifier" patch element, patch only those selected (so only those which are part of the collection) but have each selected item be on individual Dataverse rows.
So, if the user selects Bank A, Bank B and Bank C, this would create three Dataverse rows but with Bank Identifier being "Bank A" for one, "Bank B" for the next, "Bank C" for the last etc. All other information remaining the same parameters.
Any ideas please?
Thanks,
K.
Solved! Go to Solution.
Hi @Kosenurm
I assume you have a checkbox on the gallery to define whether selected or not.
ForAll(Filter(Gallery1.AllItems, Checkbox1.Value = true) As Source,
Patch(
Reservations, Defaults(Reservations),
{'Booking - Area': Dropdown2.Selected.Value},
{'Booking - Availability Status': "Reserved"},
{'Booking - Booked By': User().FullName},
{'Booking - Booked For': Dropdown6.Selected.Value},
{'Booking - Reservation Date': dp1.SelectedDate},
{'Booking - Bank Identifier': Source.FieldName},
{'Booking - Booked by Email': User().Email},
{'Booking - Notify Addresses': Text(ComboBox1.Selected.Mail)},
{'Desk Reference': ""}
) //Patch
) //Forall
Thanks,
Stalin - Learn To Illuminate
Hi @Kosenurm
I assume you have a checkbox on the gallery to define whether selected or not.
ForAll(Filter(Gallery1.AllItems, Checkbox1.Value = true) As Source,
Patch(
Reservations, Defaults(Reservations),
{'Booking - Area': Dropdown2.Selected.Value},
{'Booking - Availability Status': "Reserved"},
{'Booking - Booked By': User().FullName},
{'Booking - Booked For': Dropdown6.Selected.Value},
{'Booking - Reservation Date': dp1.SelectedDate},
{'Booking - Bank Identifier': Source.FieldName},
{'Booking - Booked by Email': User().Email},
{'Booking - Notify Addresses': Text(ComboBox1.Selected.Mail)},
{'Desk Reference': ""}
) //Patch
) //Forall
Thanks,
Stalin - Learn To Illuminate
Thanks for your reply.
The gallery only displays those items where the individual checkboxes are selected on the desk-map (this is a deskbooking app), so there are no checkboxes in the gallery itself.
How could I change the code you have provided so that just for anything which is in Gallery1 is patched in a ForAll way?
Thanks
K.
User | Count |
---|---|
125 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
215 | |
181 | |
139 | |
97 | |
83 |