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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (44,423)