cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Managing a variable value with OnEdit and OnView SharePoint integration functions

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions

@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.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

@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.

Anonymous
Not applicable

@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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

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 Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,913)