Hi @mdevaney, sorry I tried to edit the last post and it got marked as spam. It keeps happening!
I've copied the original post into here and added the image below.
I have a gallery which shows the steps of a process. Selecting an item in the gallery fetches and displays the step record (which is stored in record variable varThisStep).
Each item in the gallery has a "Complete" field, which is boolean. I have a 'Mark Complete' button which, when Complete is false for the current item, Patches the item's complete field to true and sets varThisStep to the next item in the gallery. I would also like this button to 'Mark Incomplete' when Complete is true. In this case, there will be no change to varThisStep.
Here is my formula:
With(
{
thisstep: LookUp(colProcessSteps, StepID = varThisStep.ID)
},
With(
{
nextstepnumber: thisstep.StepNumber + 1
},
With(
{
nextstepid: LookUp(colProcessSteps, StepNumber = nextstepnumber).StepID
},
If(
thisstep.Complete,
Patch(colProcessSteps, thisstep, {Complete: false}),
Patch(colProcessSteps, thisstep, {Complete: true});
Set(varThisStep, LookUp(BusinessProcessSteps, ID = nextstepid))
)
)
)
)
I'm getting red squiggles under the semicolon after the second patch and the error is:
Invalid argument type (Boolean). Expecting a Record value instead
Removing the Set() fixes it. What is it about the Set that it doesn't like?
Thank you!
Joel