
Announcements
Hello everyone,
I am a beginner in power app and I am currently working on creating a Timesheet Power App.
I created a new timesheet page to submit new records and updating existing records (see : New timesheet page), datas are directly connected to a sharepoint list.
I have trouble with management of the dropdown list "stream" in a gallery.
If "Project 1" is selected in the first item of the gallery, I want after generating a second line to create a second item in the gallery to disable the option to select "Project 1" in the dropdown list. Same action for all items N+1 until there is no more available project in my dropdown list.
Actually I tried 2 methods :
(1) This block well the selection of stream already used but also update oldest item not in the sharepoint list but in the gallery and I don't undestand how I can prevent that.
Item of my drop down list : Filter( Stream, !CountRows( Filter( UsedStreams, Stream = Value ) ) ).Stream
Add button : Patch( Timesheet, Defaults(Timesheet_Audika),
{ Collaborateur:Collaborateur_1.SelectedText.Value,
Titre:Concatenate(Text(GUID())),
Semaine: Text(Week_dropdown.Selected.'Week Display'),
Stream: Stream_DB_3.SelectedText.Value });
ClearCollect(TimesheetLines,Filter(Timesheet,Collaborateur=User().FullName,Semaine=Week_dropdown.SelectedText.Value);
ClearCollect(UsedStreams, Distinct(Timesheet, Stream))
Saved in the sharepoint list button : Patch(Timesheet,ThisItem,
{Collaborateur:Collaborateur_1.SelectedText.Value,
Titre:Text((GUID()))),
Semaine: Text(Week_dropdown.Selected.'Week Display'),
Status : "Enregistré",
Stream: Stream_DB_3.SelectedText.Value,
Total_heures: Value(Total_H_3.Text)});
ClearCollect(UsedStreams,Distinct(Filter(Timesheet,
Semaine = Week_dropdown.SelectedText.Value &&
Status = "Enregistré" &&
Collaborateur = Collaborateur_1.SelectedText.Value),
Stream));
(2) I tried a second way adding || Stream =ThisItem.Stream it solve the first issue but my problem is not totaly resolve because when I create an item 2 i can select projet 1. I can't select projet 1 from the item 3 only.
Item of my drop down list : Filter(Stream_audika,!CountRows(Filter(UsedStreams,Stream = Value)) || Stream =ThisItem.Stream).Stream
Others function as 1 testing
Thank you for your help. I have conducted extensive research, but I am currently blocked due to these issues.