Hi,
Bit of background, I have a Commission App, there are two types of user, end user submitting a commission, and admin reviewing, approving/editing the commissions.
For the end user, when they are completing the form, I wanted to give them an option to save as draft, so I created a choice column on my SharePoint List. To achieve the result I needed, I applied a local variable on two buttons on the form.
Draft Button - and put the following on the OnStart, UpdateContext({locDraftSubmit:false})
Submit button - and put the following on the OnStart, UpdateContext({locDraftSubmit:true})
On the Update property the forms Datacard I had the following code:
If(locDraftSubmit,{Value:"Submitted"},{Value:"Draft"})
This worked from, it updated the status column to Draft or Submitted depending on which button was pressed.
The problem I had was when admins edited and save any items, it changed the Status, so in an effort to get round this I created a variable which checks if the logged in user is on the admin list, and put this following code in the Update property...
If(varIsGlobalAdmin,ThisItem.Status.Value, If(locDraftSubmit,{Value:"Submitted"},{Value:"Draft"})
My intention being to say If the user is on the admin list, save whatever is in ThisItem, but if the user isnt admin, then do the If(locDraftSubmit,{Value:"Submitted"},{Value:"Draft"}) part.
But I get the error Invalid argument type record, expected Text value. Where am I going wrong?
Thanks in advance.