Hi this may be a bit confusing so ask me questions if needed.
I have three SharePoint lists.
Sales Person
Opportunity
Product
On the Opportunity list is a column that ties it to the sales person and on the Product there is a column that ties it to the Opportunity, but there is no direct column on product tying it to the Sales Person.
Sales person also has a column called Active (yes/no)
Opportunity has a column called Open (yes/no)
Product has a column called Available (yes/no)
What I want to do is when a sales person is marked as no longer active, I want the associated opportunities to be marked as not open and the associated products to those opportunities to be marked not available.
So using UpdateIf I am able to easily update the opportunities to the correct status when the sales person toggle changes in Power Apps, but I'm having a challenge figuring out how to then also update the products associated to the opportunities.
Here's my code for updating the opportunities when the sales person changes to not active (datacardvalue104), again this works, ... just need help then updating the products tied to any changed opportunities.
If(
DataCardValue104.Value = false,
UpdateIf(
Opportunities,
'Account Manager'.DisplayName = Gal_AMs.Selected.Name.DisplayName,
{
CloseDate: Now(),
Open: false
}
),
false
)
Maybe create an array or something of the IDs for the Opportunities that were updated?? Or is there something else I can do?
Thanks,
Terry