cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted

Re: Updateif (person field)

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
Highlighted

Re: Updateif (person field)

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

Highlighted
Helper I
Helper I

Re: Updateif (person field)

No dont work

 

Thank you for response

Highlighted

Re: Updateif (person field)

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

Highlighted
Helper I
Helper I

Re: Updateif (person field)

I think the probem is Assginedto is a person or group field 

Highlighted

Re: Updateif (person 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?

Highlighted
Helper I
Helper I

Re: Updateif (person field)

That is my sp list definition

Highlighted

Re: Updateif (person field)

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

Highlighted
Helper I
Helper I

Re: Updateif (person field)

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

Highlighted

Re: Updateif (person field)

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,587)