cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SGavoux
Helper I
Helper I

Updateif (person field)

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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!

View solution in original post

12 REPLIES 12

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!

View solution in original post

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:""}})

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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