Hypothetically, I have two SP lists (this is a very simplified version of what I'm actually using) - a list of ongoing projects, and a list of available resources to assign to those projects. In the ongoing projects list, I have a multi-value lookup column for "Resources", and this pulls items from the other list.
Projects:
Project Number | Assigned Resources |
1 | A, B |
2 | C |
3 |
Resources:
Resource Name | Resource Type | Assigned Project |
A | Large Truck | 1 |
B | Small Truck | 1 |
C | Clown Car | 2 |
The Projects list has a custom PowerApps form that filters the resources available to select based on whether they are already assigned, to prevent selecting the same resource twice. Currently, I have a recurring Flow set up to periodically update the Resources list with the assigned project, as selected in the Project list. This makes it difficult in case a resource is selected, then accidentally unselected - it will not be available for re-selection until the Flow runs, or if the user manually changes the project assignment. Is there any way for PowerApps (either in the custom form, or in a Canvas App) to automatically update the resource list with the assigned project, as the values are selected? I suppose more importantly - is there a way for PowerApps to remove the assigned project value, if a resource is un-selected?
Thanks in advance!
Solved! Go to Solution.
Hi @jwinega4 ,
Is the 'Assigned Resource' column a multi-value lookup column in your Projects List?
Do you want to grab the IDs of the any items that had been "unselected" within your ComboBox?
If you want to grab the IDs of the any items that had been "unselected" within your ComboBox, please try the following workaround:
Set the OnChange property of the ComboBox in the Edit form to following:
Clear(UnselectOptions);
ForAll(
ThisItem.'Trip Status',
If(
Not(Value in DataCardValue14.SelectedItems.Value),
Collect(UnselectOptions, Value)
)
)
On your side, you should set the OnChange property of the Assigned Resources ComboBox to following:
Clear(UnselectOptions);
ForAll(
ThisItem.'Assigned Resources',
If(
Not(Value in AssignedResourcesComboBox.SelectedItems.Value),
Collect(UnselectOptions, Value)
)
);
// use Patch function to remove the assigned project value for current Project Item in your Resources List
ForAll(
UnselectOptions,
Patch(
'Resources List',
LookUp('Resources List', 'Resource Name' = Value),
{
'Assigned Project': Blank()
}
)
)
Note: I assume that each Resource Item could only be assigned to single one Project Item.
Please try above solution, check if the issue is solved.
Regards,
Some extra info is probably needed here:
In both the custom PowerApps Sharepoint form, and in a Canvas app I have built over the project list for ease of phone use by certain end users, the "resource" selection is a ComboBox. My thought is, in the OnChange property of the ComboBox, to use a filter function on the relevant SP list and a patch function to make the changes - but I can't see where I'd be able to grab the IDs of the any items that had been "unselected" to change them back to unassigned, only any additional selections made.
Hi @jwinega4 ,
Is the 'Assigned Resource' column a multi-value lookup column in your Projects List?
Do you want to grab the IDs of the any items that had been "unselected" within your ComboBox?
If you want to grab the IDs of the any items that had been "unselected" within your ComboBox, please try the following workaround:
Set the OnChange property of the ComboBox in the Edit form to following:
Clear(UnselectOptions);
ForAll(
ThisItem.'Trip Status',
If(
Not(Value in DataCardValue14.SelectedItems.Value),
Collect(UnselectOptions, Value)
)
)
On your side, you should set the OnChange property of the Assigned Resources ComboBox to following:
Clear(UnselectOptions);
ForAll(
ThisItem.'Assigned Resources',
If(
Not(Value in AssignedResourcesComboBox.SelectedItems.Value),
Collect(UnselectOptions, Value)
)
);
// use Patch function to remove the assigned project value for current Project Item in your Resources List
ForAll(
UnselectOptions,
Patch(
'Resources List',
LookUp('Resources List', 'Resource Name' = Value),
{
'Assigned Project': Blank()
}
)
)
Note: I assume that each Resource Item could only be assigned to single one Project Item.
Please try above solution, check if the issue is solved.
Regards,
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
193 | |
45 | |
45 | |
43 | |
35 |
User | Count |
---|---|
270 | |
82 | |
81 | |
74 | |
69 |