Hi @karthik26 , Basically, I have 2 collections: col_Main and col_ForDropdown.
col_Main: This is used as Item property of your gallery. In your case it will be same data source or collection that you are creating on click on Add button.
col_ForDropdown: This is used as Item property of dropdown, but in different way.
OnSelect of Add button, I have below code:
Collect(
col_Main,
{Value: ""}
);
OnVisible of Screen, i have this code: In your case it should be items that you might be pulling it from some source with distinct values. In top of that I have added one more column named as Added.
ClearCollect(
col_ForDropdown,
Table(
{
Value: "A",
Added: false
},
{
Value: "B",
Added: false
},
{
Value: "C",
Added: false
},
{
Value: "D",
Added: false
},
{
Value: "E",
Added: false
},
{
Value: "F",
Added: false
},
{
Value: "G",
Added: false
}
)
);
Now the AllowEmptySelection is true for dropdown which is within your gallery.
The Default of dropdown is ThisItem.Value
OnChange Property of dropdown is
Update(
col_Main,
ThisItem,
{Value: Self.Selected.Value}
);
Update(
col_ForDropdown,
LookUp(
col_ForDropdown,
Value = Self.Selected.Value
),
{
Value: Self.Selected.Value,
Added: true
}
);
NOTE: col_Main collection, I have only one column Value, in your case you need to have all columns which is required.
And the Item property of your dropdown will be:
If(
ThisItem.Value in col_ForDropdown.Value && LookUp(
col_ForDropdown,
Value = ThisItem.Value
).Added = true,
col_ForDropdown,
Filter(
col_ForDropdown,
Added = false
)
)
So basically, I am patching the selected value as true in Added column and then based on selection , I make the Item property dropdown in conditional way.
Again, you need to work on this code as per your requirement.
-----------------------------------------------------------------------------------------------------------------------------
I hope this helps.
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.👍
Thanks,
ANB