Please help.
My idea is simple after submit a form
if AssignedTo.email is blank put in this a default email but my code not work
OnSuccess -> UpdateIf(mylist1,SelectedTicket.AssignedTo.Email=Blank(),{AssignedTo:Email:"mydefault@mail.com"})
-AssignedTo is person or group record type....
Solved! Go to Solution.
The update needs a complete collection detail (don't take my complete example because I've put empty strings for the other columns.. please adapt it to put the right values.. but, bottom line, If I do as follow, I don't get any errors any moe:
UpdateIf(mylist,IsBlank(AssignedTo),{AssignedTo:{Claims:Concatenate("i:0#.f|membership|",User().Email),Department:"",DisplayName:"",Email:"a@a.com",JobTitle:"",Picture:""}})
see if this helps out!
Hello Svagoux,
have you considered using the IsBlank() function instead ?
OnSuccess -> UpdateIf(mylist1,IsBlank(SelectedTicket.AssignedTo.Email),{AssignedTo:Email:"mydefault@mail.com"})
It may be similar to comparing Null values in some languages where nothing actually equals a NULL, but you have to issue a function such as IsNull to know... see if this works out better for you
No dont work
Thank you for response
Do you have a red indicator in your formula or it's error free ?
AssignedTo:Email:
Shouldn't that be more like AssignedTo.Email:
?
or in fact, I think it's more something like this (maybe if you'd provide a sample of 'mylist' structure it could help)
OnSuccess -> UpdateIf(mylist1,SelectedTicket.AssignedTo.Email=Blank(),{Email:"mydefault@mail.com"})
I think the probem is Assginedto is a person or group field
1. Have you tried without the 'AssignedTo.' prefix in your collection update part ?
2. Do you have the definition of your collection so I could test similar on my end?
That is my sp list definition
The update needs a complete collection detail (don't take my complete example because I've put empty strings for the other columns.. please adapt it to put the right values.. but, bottom line, If I do as follow, I don't get any errors any moe:
UpdateIf(mylist,IsBlank(AssignedTo),{AssignedTo:{Claims:Concatenate("i:0#.f|membership|",User().Email),Department:"",DisplayName:"",Email:"a@a.com",JobTitle:"",Picture:""}})
see if this helps out!
UpdateIf(mylist,IsBlank(AssignedTo),{AssignedTo:{Claims:Concatenate("i:0#.f|membership|",User().Email),Department:"",DisplayName:"",Email:"a@a.com",JobTitle:"",Picture:""}})
hmmm
Make a bit of progress BUT
The command runs ok BUT in my sharepoint List on AssignedTo field - puts my email (from uses.Email) not Email:"a@a.com"
There is other solution with patch function ???
simply because in my example, I had put the claims part to be with my user id email..
UpdateIf(mylist,IsBlank(AssignedTo),{AssignedTo:{Claims:Concatenate("i:0#.f|membership|",User().Email),Department:"",DisplayName:"",Email:"a@a.com",JobTitle:"",Picture:""}})
change to:
UpdateIf(mylist,IsBlank(AssignedTo),{AssignedTo:{Claims:Concatenate("i:0#.f|membership|","a@a.com"),Department:"",DisplayName:"",Email:"a@a.com",JobTitle:"",Picture:""}})
User | Count |
---|---|
136 | |
134 | |
78 | |
72 | |
69 |
User | Count |
---|---|
222 | |
136 | |
78 | |
60 | |
54 |