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?
Solved! Go to Solution.
@Anonymous ,
No, if they do not work, leave the built-in controls alone. You may have to do something at Screen OnVisible.
To be honest, if you are going to need to to complex things, consider a Canvas App - the integrated forms, from what I see were primarily designed to simply edit, view and create records and I have seen too many posts on things not working as the user expects.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
@Anonymous ,
I am not sure this is the answer you want, but altering those built-in controls produce unexpected results, not just in Variables. I suggest you set them with other triggers on forms - for instance test for the FormMode of the form and set accordingly.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
@WarrenBelz , thank you. Noted.
Just to clarify, do you mean, I should test OnEdit and OnNew controls with the FormMode ?
@Anonymous ,
No, if they do not work, leave the built-in controls alone. You may have to do something at Screen OnVisible.
To be honest, if you are going to need to to complex things, consider a Canvas App - the integrated forms, from what I see were primarily designed to simply edit, view and create records and I have seen too many posts on things not working as the user expects.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
192 | |
45 | |
45 | |
38 | |
36 |
User | Count |
---|---|
261 | |
83 | |
81 | |
69 | |
69 |