cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SGavoux
Level: Powered On

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
ZePowerDiver
Level 8

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
ZePowerDiver
Level 8

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

SGavoux
Level: Powered On

Re: Updateif (person field)

No dont work

 

Thank you for response

ZePowerDiver
Level 8

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

SGavoux
Level: Powered On

Re: Updateif (person field)

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

ZePowerDiver
Level 8

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?

SGavoux
Level: Powered On

Re: Updateif (person field)

That is my sp list definition

ZePowerDiver
Level 8

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

SGavoux
Level: Powered On

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

ZePowerDiver
Level 8

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,609)