Hello,
There is a text field named "Flag", default value ="Y", I want it changes to "N" when cilcking on the "Save" button, the formulas as below:
OnSelect of the "Save" button:
UpdateContext({varFlag:OSART.Flag,value:"N"});SubmitForm(SharePointForm1)
onStart of APP : set(varFlag, OSART.Flag) (not sure it is the right place, should be OSART.Flag (listname.fieldName)
it is not working. 😞
Thanks,
Solved! Go to Solution.
Don’t use choice fields in SharePoint. Change it to single line of text and set the options by hard coding them in the PowerApps controls.
Hi @Linda777
Global variables cannot be used as a context variable. If you use Set() in the OnStart property of the app, you will need to be consistent throughout the app and use Set() to change the state of the variable, not UpdateContext().
Hi Drrickryp,
Yes, Now I learn the local and gable variable. it works
1. default of the Flag field : If(SharePointForm1.DisplayMode=FormMode.New,Parent.Default,varFlag)
2. Onselect of the button:
UpdateContext({varFlag:"N"});SubmitForm(SharePointForm1)
Thanks,
One small change, I would put the UpdateContext({varFlag:"N"}) in the OnSuccess property of the form. I don't think that you want it to change unless the form successfully submits the record. IMHO, rarely put anything but SubmitForm() in the button that actually submits the form as you don't want to execute additional commands unless the form submits successfully.
Hello Drrickryp,
As you can see, I am new in PowerApps, I am trying step by step, I want the field to be changed is choice type, now it is working if I put the formula as below in the"onSelect" of the button.
If(DataCardValue15.Selected.Value="NEW",UpdateContext({varStatus:LookUp(Choices(OSART.Status),Value="ASSIGNED") }),false);
then I put it in the "OnSuccess" property of the form as you suggest, it is not working, I am not sure if the datacardValue is not correct in here or anything wrong as I don't know what should change if move from a property of the button to a property of the form. a lots need to learn.
Thank you very much for your tips. 🙂
Don’t use choice fields in SharePoint. Change it to single line of text and set the options by hard coding them in the PowerApps controls.
Thanks Drrickryp. I will do. 🙂
User | Count |
---|---|
221 | |
98 | |
95 | |
55 | |
34 |
User | Count |
---|---|
273 | |
107 | |
105 | |
60 | |
60 |