Here is my formula:
If(
Checkbox1.Value=true,
Patch('AtNeed Complete v2S', ThisItem, {'Task Completed - Sales Followup':"Yes", 'Task Completed - Sales Date':Today(), 'Task Completed - Sales Associate':User()}),
Patch('AtNeed Complete v2S', ThisItem, {'Task Completed - Sales Followup': "", 'Task Completed - Sales Date':"", 'Task Completed - Sales Associate':""})
)
Here is what I would like to do when a user clicks Checkbox1:
*Set CDS field 'Task Completed - Sales Followup' to Yes
*Set CDS field 'Task Completed - Sales Date' to Today
*Set CDS field 'Task Completed - Sales Associate' to the user that clicked the box.
I can accomplish the first two, but cannot get the user recorded.
I get the following three errors:
Invalid argument type.
Expecting a Record value, but of a different schema.
Missing column. Your formula is missing a column 'Access Mode' with a type of 'OptionSetValue'.
The function 'Patch' has some invalid arguments.
In CDS, the field 'Task Completed - Sales Associate' is set as a Data type of Lookup and Related entity of User.
Here is what I would like to when a user unclicks Checkbox1:
*Clear CDS field 'Task Completed - Sales Followup'
*Clear CDS field 'Task Completed - Sales Date'
*Clear CDS field 'Task Completed - Sales Associate'
The only one of these tasks I've been successful with is the first.
Can someone help me with entering the user information and clearing the date?
Solved! Go to Solution.
Hi @RStanley ,
Since lookup field is a complex data type, you need a little special formula to update it.
I suggest you try this formula:
Patch('AtNeed Complete v2S', ThisItem, {'Task Completed - Sales Followup':"Yes",
'Task Completed - Sales Date':Today(),
'Task Completed - Sales Associate':LookUp(Users,'Full Name'=User().FullName)})
Here's a issue about how to update lookup data type of cds in powerapps for your reference:
The second thing that you want to, I'm afraid it's not supported in PowerApps currently.
Because "" is text type, while the three columns that you want to update to blank are all not text type.
However, there's an alternative way to make this, please refer this issue:
Best regards,
what is the type of the 'Task Completed - Sales Associate' field? is it a lookup field to the Users entity? also I noticed that you are setting that field to User(). the User() function returns a record and you can't patch it to a single column. Try using User().Email or User().FullName
Hi @RStanley ,
Since lookup field is a complex data type, you need a little special formula to update it.
I suggest you try this formula:
Patch('AtNeed Complete v2S', ThisItem, {'Task Completed - Sales Followup':"Yes",
'Task Completed - Sales Date':Today(),
'Task Completed - Sales Associate':LookUp(Users,'Full Name'=User().FullName)})
Here's a issue about how to update lookup data type of cds in powerapps for your reference:
The second thing that you want to, I'm afraid it's not supported in PowerApps currently.
Because "" is text type, while the three columns that you want to update to blank are all not text type.
However, there's an alternative way to make this, please refer this issue:
Best regards,
Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.
Did you miss the call?? Check out the Power Apps Community Call here!
User | Count |
---|---|
257 | |
203 | |
75 | |
38 | |
31 |
User | Count |
---|---|
342 | |
215 | |
117 | |
71 | |
55 |