Hi all,
I am struggling to figure out to set a variable's value with OnEdit and OnNew SharePoint integration functions if that is all possible.
I am creating a SharePoint list with a status column which has quite a few statuses. In the canvas app, I have created a variable varStatus to set and control various status using the Switch function.
Switch(
varStatus,
"Draft",
{Value: "Draft"},
"Created",
{Value: "Awaiting docs"},
"Technologists",
{Value: "Selecting technologists"},
//and so on
Then I am using several buttons which set varStatus value like this:
/*set status var*/
Set(
varStatus,
"Draft"
)
I am also saving the text value of the varStatus to a text column varStatus_Textvalue, which has its Default =
If(
!IsBlank(varStatus),
varStatus,
Parent.Default
)
Finally, I am trying to control varStatus value with the OnEdit and OnNew SharePoint integration functions. When the user tries to create a new item in the SharePoint list, I use <em>Set(varStatus, blank()) to reset the variable, but the user wants to edit an existing item, and I am trying to use the following function in the OnEdit SharePoint integration:
If(
!IsBlank(txt_varStatus.Text),
Set(
varStatus,
txt_varStatus.Text
)
)
However, the function above does not work for some reason.. Could someone please advice, if there is anything wrong with it?