Hi All.
I have two columns in a gallery called "Phase" and "Work Product Process". Both are dropdown values which gets loaded from another SharePoint list. Whenever a new project is created in "Gate scope" the phase and work product for that respective project will be chosen and saved in SP list. (For eg, Phase is Governance and work product is Code and Phase is Governance and work product is CAR Report). For the created project I need to enter Gate tracker details which collects the value of Phase and work Product for the selected project from "Gate Scope" and the remaining values are entered and saved. The code to collect the Phase and Work Product for the specific project in items property is:
Phase:
Distinct(Filter(
Gate_Review_Phase,
'Project Name' = prjnamesphs.Selected.ProjectName
),Phase).Result
Work Product:
Distinct(Filter(
Gate_Review_Phase,
'Project Name' = prjnamesphs.Selected.ProjectName && Phase = phasedropdown.Selected.Result
),'Work Product/Process').Result
When the user selects Governance and Code for the first time it gets saved. For the second time when the user selects governance and code again code must not allowed to select since its is already selected.
Any help on this to implement would be greatly appreciated.
Thanks!
@Uthhra ,
I will be honest, we would have progressed much quicker if you had posted that highly relevant piece of code at the start. I do not fully grasp the logic in the last part of your Filter, however you now need this to be dynamic (or you will be re-collecting every time the dop-down is chosen). I will give you a start here (I will offline now for some time) - the Items of your gallery need to be something like this
With(
{
wData:
Distinct(
GatereviewPlan_tracker
GateID
)
);
ForAll(
wData,
LookUp(
Gatetracker,
'Project Name' =
If(
'Project Name' = prjnamesphs.Selected.ProjectName,
'Project Name'
) &&
GateID = Result &&
!(GateID in colChoices.Value)
)
)
);
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
This is written On select of the button to collect the list items:
Clear(Gate tracker);
Collect(
Gatetracker,
GatereviewPlan_tracker
);
ClearCollect(
colDistinct,
Distinct(
Gatetracker,
GateID
)
);
Clear(colFinal);
ForAll(
colDistinct,
Collect(
colFinal,
First(
Filter(
Gatetracker,
'Project Name' = If(
'Project Name' = prjnamesphs.Selected.ProjectName,
'Project Name'
) && GateID = Result
)
)
)
);
Gallery items is:
colFinal
@Uthhra ,
What are the current Items of the Gallery ?
I have mentioned in my first part of the question itself in a gallery I have two dropdown and this restriction should happen inside gallery only.
@Uthhra ,
Sorry, but I am getting lost here - you mentioned drop-downs in your first post (which I have been focussed on and actually built a model to test it all). I really do not understand how the gallery comes into all of this - your question posted as When the user selects Governance and Code for the first time it gets saved. For the second time when the user selects governance and code again code must not allowed to select since its is already selected.
You simply need to put the value you want to exclude into the collection, then filter for the result you want excluding that value.
Now values is getting listed in dropdown but only one value is listed(code) instead of two(code, car report). ThisItem.Result is giving an error stating Result is not recognized.
@Uthhra ,
OnSelect of the Gallery should work, but instead of Self.Selected.Result, use ThisItem.Result
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
I am using a gallery to update the values in SharePoint. Because of that does it not working as expected.
@Uthhra ,
As I noted, I tested it (again now) and it works as expected. Please look at the logic yourself - initialise Collection screen OnVisible
ClearCollect(
colChoices,
{Value: Blank()}
)
Add any selected item selected to the Collection OnSelect of the Combo Box (small but not necessary clarification added here)
Collect(
colChoices,
{Value: Self.Selected.Result}
)
Now filter the Combo Box Items to exclude any records in the collection
Filter(
Distinct(
Filter(
Gate_Review_Phase,
'Project Name' = prjnamesphs.Selected.ProjectName
),
Phase
),
!(Result in colChoices.Value)
).Result
This code
!(Result in colChoices.Value)
simply means to exclude records in colChoices from the selection.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
The code which you posted ! (Result in colChoices.Value) when I remove the not in the starting it is listing both the values in dropdown but only one value filtering is not happening and when I add ! the dropdown display blank values.
Filter(
Distinct(
Filter(
Gate_Review_Phase,
'Project Name' = prjnamesphs.Selected.ProjectName
),
Phase
),
!(Result in colChoices.Value)
).Result
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional