cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cwilki43
Frequent Visitor

Error Comparing LookUp Return Value

I'm trying to have the text of a label change based on if there's an entry in a SP list, and then another if statement based on the text of the entry. My formula is:

If(IsBlank(LookUp('MIC Interview_1', 'Project Heading' = ThisItem.'Project Heading (AM short title)' && 'MIC Email' = User().Email, 'Ford PI')), "INCOMPLETE", If(LookUp('MIC Interview_1', 'Project Heading' = ThisItem.'Project Heading (AM short title)' && 'MIC Email' = User().Email, 'Do you understand your role as an MIC?') = 'I am not the correct MIC for this project', "INCORRECT MIC", "COMPLETE"))

I'm trying to make it so that the value in the column 'Do you understand your role as an MIC?' is compared to 'I am not the correct MIC for this project'. 

The error I'm getting is: "Name isn't valid. 'I am not the correct MIC for this project' isn't recognized.

Any help would be appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @cwilki43 ,

 

I believe the column of that question should be of type Choice, since you cannot force every user type in the exact same words especially they are case sensitive, am I right?

 

If that column is of type Choice, please try below formula:

If(
    IsBlank(
        LookUp(
            'MIC Interview_1', 
            'Project Heading' = ThisItem.'Project Heading (AM short title)' && 'MIC Email' = User().Email, 'Ford PI'
        )
    ), 
    "INCOMPLETE", 
    If(
        LookUp(
            'MIC Interview_1', 
            'Project Heading' = ThisItem.'Project Heading (AM short title)' && 'MIC Email' = User().Email, 
        ).'Do you understand your role as an MIC?'.Value = "I am not the correct MIC for this project", 
        "INCORRECT MIC", 
        "COMPLETE"
    )
)

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
BCBuizer
Super User
Super User

Hi,

 

It seems there's a reference to ThisItem missing:

If(
	IsBlank(
		LookUp(
			'MIC Interview_1',
			'Project Heading' = ThisItem.'Project Heading (AM short title)' &&
			'MIC Email' = User().Email,
			'Ford PI'
		)
	),
	"INCOMPLETE",
	If(
		LookUp(
			'MIC Interview_1',
			'Project Heading' = ThisItem.'Project Heading (AM short title)' &&
			'MIC Email' = User().Email, 
			'Do you understand your role as an MIC?'
		)= ThisItem.'I am not the correct MIC for this project',
		"INCORRECT MIC",
		"COMPLETE"
	)
)

 

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

I don't think that works, doesn't ThisItem refer back to the record in my gallery? I want the return value of LookUp being compared to the string "I am not the correct MIC for this project"

Hi @cwilki43 ,

 

In that case replace the single quotes with doubles:

 

If(
	IsBlank(
		LookUp(
			'MIC Interview_1',
			'Project Heading' = ThisItem.'Project Heading (AM short title)' &&
			'MIC Email' = User().Email,
			'Ford PI'
		)
	),
	"INCOMPLETE",
	If(
		LookUp(
			'MIC Interview_1',
			'Project Heading' = ThisItem.'Project Heading (AM short title)' &&
			'MIC Email' = User().Email, 
			'Do you understand your role as an MIC?'
		)= "I am not the correct MIC for this project",
		"INCORRECT MIC",
		"COMPLETE"
	)
)


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
v-jefferni
Community Support
Community Support

Hi @cwilki43 ,

 

I believe the column of that question should be of type Choice, since you cannot force every user type in the exact same words especially they are case sensitive, am I right?

 

If that column is of type Choice, please try below formula:

If(
    IsBlank(
        LookUp(
            'MIC Interview_1', 
            'Project Heading' = ThisItem.'Project Heading (AM short title)' && 'MIC Email' = User().Email, 'Ford PI'
        )
    ), 
    "INCOMPLETE", 
    If(
        LookUp(
            'MIC Interview_1', 
            'Project Heading' = ThisItem.'Project Heading (AM short title)' && 'MIC Email' = User().Email, 
        ).'Do you understand your role as an MIC?'.Value = "I am not the correct MIC for this project", 
        "INCORRECT MIC", 
        "COMPLETE"
    )
)

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,022)