@Koen Mathijs,
Thanks! I'll give this a try.
My actual query is different from the one that I mentioned in this thread.
Actually I have a toggle inserted to the PowerApps form (added from SharePoint list). There is a Power Automate trigger to check, if the toggle is switched to Yes, an email will be sent , If No, will skip to send email.
But for some reason, when we switch the trigger to "Yes", and after an email is sent, the SharePoint Trigger column gets unchecked and in PowerApps form also the Trigger column gets changed to No automatically.
Basically what I was looking for - If trigger is Yes, update SharePoint List and PowerApps form.
------------------------------
Prem Guru
------------------------------
Original Message:
Sent: Jan 31, 2023 04:20 AM
From: Koen Mathijs
Subject: Update SharePoint dropdown with Yes/No, when toggle is switched to Yes/No
Prem,
I don't think you can update the default value of a dropdown with a toggle, at least not so that your visible dropdown value would change on the fly.
I'm not sure what you are trying to accomplish here. Looking at your 'thisitem' code you are also using a form or a gallery?
Also the fact that you are using a dropdown column in sharepoint with yes/no values is a puzzle to me, why not use the yes/no type of field. It's much easier to work with if you want a toggle in PowerApps
If you are looking for a way to update your sharepoint Profit yes/no column from your toggle, that is possible.
On the OnChange property of your toggle:
Patch( Sharepointlist, Defaults(Sharepointlist), --> or whatever way to identify your record { profit: toggle1.value })
------------------------------
Koen Mathijs
Original Message:
Sent: Jan 30, 2023 06:36 AM
From: Prem Guru
Subject: Update SharePoint dropdown with Yes/No, when toggle is switched to Yes/No
Hello,
I have a dropdown named as Profit into SharePoint with Yes and No option. And a toggle button with Yes and No switch.
I have updated the Default property as below:
FalseText is set to No
TrueText is set to Yes
If(ThisItem.'ToggleName' = true, true, false)
Now when I switch the toggle to Yes, my Profit dropdown should automatically get updated to "Yes" to the SharePoint list, else it should be "No".
I looked around many searches but could not get a proper solution.
Please advise.
------------------------------
Prem Guru
------------------------------