I have a SharePoint list with a Choice column (Status where values are "New Request", "Active', "On Hold", "Closed") and a Toggle Switch (Approved where values are true or false).
On the EditForm, when a user changes the Toggle Switch to true, I want the Status dropdown column selection to change to "Active" but only when its value is "New Request". If the user changes the Approved toggle switch to false, I do not want the Status dropdown column selection to change.
I've been searching the forums and trying different solutions with no luck.
The closest I've gotten to a resolution is the following:
-- save the value of the Status dropdown selected value when loading form:
SharePointIntegration OnEdit: EditForm(SharePointForm1);Set(varOrigStatus, StatusDataCardValue.Selected.Value);
-- save the value of the Status dropdown selected value when the Approved toggle switch is changed:
ApprovedDataCardValue OnChange: Set(varOrigStatus, StatusDataCardValue.Selected.Value)
-- save the value of the Status dropdown selected value when a user selects a different value:
StatusDataCardValue OnSelect: Set(varOrigStatus, StatusDataCardValue.Selected.Value)
-- automatically change the Status dropdown selection to "Active" if dropdown selection is "New Request" and Approved toggle switch is true, else keep as Status dropdown selection as is:
StatusDataCard Default: If(varOrigStatus="New Request" And ApprovedDataCardValue.Value, LookUp(Choices('Test List'.Status), Value = "Active"), LookUp(Choices('Test List'.Status), Value = varOrigStatus))
I believe my biggest problem is trying to check the current value of the Status dropdown value before changing it to "Active". If I check the dropdown directly, I get a circular reference.
Any help would be appreciated!