I am creating an application which will update different spreadsheets (which all have identical templates). I'm using a switch statement for that part. Reading on the forums, I saw that the best way to update different spreadsheets was by using a patch function.
Anyways, an issue I was having is that the patch function keeps showing that there are errors, despite the fact that my syntax appears to be correct. It is hard to see from this screenshot, so I have created another patch function with a simple function, that shows the same exact error as this function.
Is there a mistake I am making with patch functions?
GenJuly is the table, YES is a column.
On the first screenshot GenYES, GenNO, and GenComm are datacards.
Solved! Go to Solution.
Your issue is probably stemming from the syntax of the multiple statements in your code. It should look more like:
SubmitForm(EditForm1);
Reset(GenCBox);
Reset(RadioA);
Switch( // with the rest of your code
Is your Switch function within a behavior property (one that starts with "On")? Patch() is a behavior function, so it can only be invoked from a behavior property.
Hi @Power_user2 ,
It seems that you appended the formula on a Label or Text Input box, please try and use it on a Button's OnSelect as mentioned by @BCLS776 .
Best regards,
Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.
Hello, sorry for the delayed response. The Switch function is within an onselect property.
The formula is being put onto an icon if that is relevant.
Your issue is probably stemming from the syntax of the multiple statements in your code. It should look more like:
SubmitForm(EditForm1);
Reset(GenCBox);
Reset(RadioA);
Switch( // with the rest of your code
Don't chain commands with SubmitForm(). Put them in the OnSuccess property of the form. You don't want them to execute if the form is not successfully submitted.
I've tried this and I believe you are right! Thanks for the help.
On a side note, how do you determine when to use semicolons between functions and when to use a plus sign?
I've never used a plus sign and this is the first I have heard that you could do it.
Will try that.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
204 | |
106 | |
56 | |
52 | |
41 |
User | Count |
---|---|
274 | |
157 | |
88 | |
81 | |
56 |