cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Nested If issues

Hi I have the following nested if statement but it not returning anything past the first if.

 

f(
And(
!IsEmpty(
Filter(
'Personal Data',
Title = Subtitle1.Text
)
),
IsEmpty(
Filter(
'Personal Data',
Matching_Alias1
)
)
),
Patch(
'Personal Data',
LookUp(
'Personal Data',
Title = Subtitle1.Text
),
{Matching_Alias1: AliasInput}),

If(IsEmpty(
Filter(
'Personal Data',
Matching_Alias2
)
)
,
Patch(
'Personal Data',
LookUp(
'Personal Data',
Title = Subtitle1.Text
),
{Matching_Alias2: AliasInput}),
If(IsEmpty(
Filter(
'Personal Data',
Matching_Alias3
)
)
,
Patch(
'Personal Data',
LookUp(
'Personal Data',
Title = Subtitle1.Text
),
{Matching_Alias3: AliasInput}))));

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper III
Helper III

Re: Nested If issues

I got it working this way

 

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, IsBlank(Matching_Alias1 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text),{Matching_Alias1:AliasInput}));

 

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, !IsBlank(Matching_Alias1 =""),IsBlank(Matching_Alias2 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text{Matching_Alias2:AliasInput}));

 

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, !IsBlank(Matching_Alias1 =""),!IsBlank(Matching_Alias2 =""), IsBlank(Matching_Alias3 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text),{Matching_Alias3:AliasInput}));

View solution in original post

18 REPLIES 18
Highlighted
Super User III
Super User III

Re: Nested If issues

@Imahmuti
I have a question for you about this section of code...

IsEmpty(
Filter(
'Personal Data',
Matching_Alias1
))

Was there any reason why you did not include
a value to filter matching alias on like this?

IsEmpty(
Filter(
'Personal Data',
Matching_Alias1 = “Freddie”
))

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
Highlighted
Helper III
Helper III

Re: Nested If issues

I am glad you picked up on it, as I was having an issue conceptualizing that as well. I did not know how to say that if Matching_Alias is empty. I had another version saying Matching_Alias1 =""

 

 

Highlighted
Helper III
Helper III

Re: Nested If issues

I also tried this version but did not work

 

If(
And(
!IsEmpty(
Filter(
'Personal Data',
Title = Subtitle1.Text
)
),
IsEmpty('Personal Data'.Matching_Alias1))
,
Patch('Personal Data',LookUp('Personal Data',Title = Subtitle1.Text),
{Matching_Alias1: AliasInput}),
If(IsEmpty('Personal Data'.Matching_Alias2)

,
Patch('Personal Data',LookUp('Personal Data',Title = Subtitle1.Text),
{Matching_Alias2: AliasInput})....

Highlighted
Dual Super User III
Dual Super User III

Re: Nested If issues

I had the same question, but what I think you are looking for is 

isBlank(Matching_Alias1)

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Helper III
Helper III

Re: Nested If issues

Tried IsBlank before with the same results 😞

Highlighted
Dual Super User III
Dual Super User III

Re: Nested If issues

Yes, but did you include the Data source when you tried isBlank?  Your examples suggest you did.  You are checking whether a variable is blank, not a field in a data source.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Helper III
Helper III

Re: Nested If issues

I tried both IsBlank('Personal Data'.Matching_Alias1) and IsBlank(Matching_Alias1) both did not work. Sorry I am quite new to this

Highlighted
Helper III
Helper III

Re: Nested If issues

I got it working this way:

 

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, IsBlank(Matching_Alias1 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text),{Matching_Alias1:AliasInput}));

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, !IsBlank(Matching_Alias1 =""),IsBlank(Matching_Alias2 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text),{Matching_Alias2:AliasInput}));

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, !IsBlank(Matching_Alias1 =""),!IsBlank(Matching_Alias2 =""), IsBlank(Matching_Alias3 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text),{Matching_Alias3:AliasInput}));

Highlighted
Helper III
Helper III

Re: Nested If issues

I got it working this way

 

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, IsBlank(Matching_Alias1 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text),{Matching_Alias1:AliasInput}));

 

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, !IsBlank(Matching_Alias1 =""),IsBlank(Matching_Alias2 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text{Matching_Alias2:AliasInput}));

 

If(IsBlank(LookUp('Personal Data',And(Title = Subtitle1.Text, !IsBlank(Matching_Alias1 =""),!IsBlank(Matching_Alias2 =""), IsBlank(Matching_Alias3 = "")))),

Patch('Personal Data',LookUp('Personal Data', Title = Subtitle1.Text),{Matching_Alias3:AliasInput}));

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published 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 (3,584)