web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PCF Control Lookup fie...
Power Apps
Answered

PCF Control Lookup field is getting update on the form

(0) ShareShare
ReportReport
Posted on by 24

Hi,

 

I am able to select an item from the lookup.  When I select an item my OnSelectItem event is working.

 

I can see the selected data to build the lookup.   But the form is not getting assigned the selected lookup.

public init(context: any, notifyOutputChanged: (value?: IOutputs) => void, state: any, container: HTMLDivElement): void {
        const onItemSelected = (selectedItem: any) => {
            console.log('onItemSelected event triggered');

            try {
                if (selectedItem) {
                    // Set the new value directly
                    const newValue: ComponentFramework.LookupValue[] = [{
                        entityType: "lfs_systemitemgroup",
                        id: selectedItem._lfs_systemitemgroupid_value,
                        name: selectedItem.lfs_systemitemgroupname
                    }];

                    notifyOutputChanged({ lfs_SystemItemGroupId: newValue });
                } else {
                    // Clear the value of the lookup field if nothing is selected
                    //context.parameters.lfs_SystemItemGroupId.raw.setValue(null);
                    notifyOutputChanged({ lfs_SystemItemGroupId: undefined });
                }
                if (selectedItem) {
                    alert("help");
                }
            } catch (error: any) {
                console.error("Error setting lookup field value:", error.message);
            }
        };
I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    3,306 Most Valuable Professional on at

    NotifyOutputChange doesn't accept any parameters. You have to call it to notify that output changed and put the assigning of the new value to the getOutputs function. You can check an example exactly with the lookup in the following repository - https://github.com/AndrewButenko/LookupToOptionset/blob/main/LookupToOptionset/index.ts

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 421

#2
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 278 Super User 2026 Season 1

Last 30 days Overall leaderboard