Hello ,
I have a scenario and I am trying to get it passed, hoping if somebody can assist here please.
I have 2 tables :
Holiday_Per_Shift :
| Calendar_Date | NightorDay | Shift | Business_Unit | Slot_ID | Slots |
| 31/05/2023 | D | B | Phase 6 | 1 | 5 |
Employee_Details:
| Employee_Name | Employee_Slot_ID(auto generated) | Slot_ID |
| Test1 | 1000-0001 | 1 |
| test2 | 1000-0002 | 1 |
Employee_Details column Slot_ID is a lookup column based on Holiday_Per_Shift table
Using Power Apps, dynamic control , I am able to select a date in Calendar and show the information in gallery.
Now, I have added a button in the App screen and I want it to patch information in these 2 tables according if slots available >0
Scenario 1:Update Holiday_Per_Shift and identify slot_id based on Calendar_Date(comes from calendar) ,
NightorDay,Shift,Business_Unit (comes from dropdown) and reduce slot by 1
Expected data in table :
| Calendar_Date | NightorDay | Shift | Business_Unit | Slot_ID | Slots |
| 31/05/2023 | D | B | Phase 6 | 1 | 4 |
Scenario 2 :Add new record to Employee_Details table like :
| Employee_Name | Employee_Slot_ID(auto generated) | Slot_ID |
| ABC | 1000-0001 | 1 |
| XYZ | 1000-0002 | 1 |
| username() from power apps | Auto generated value | 1 (comes based on fields selection) |
Can someone please help me how I can achieve this?

Report
All responses (
Answers (