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 / Unable to set LookUp c...
Power Apps
Unanswered

Unable to set LookUp column value from power app customize forms

(0) ShareShare
ReportReport
Posted on by 10

Hello everyone,
 I have been struggling with one combo box issue when I use Add columns function and create a new column in the combo box "items" property. Afer submit my list has no value for the column "Project"(lookup column of another list) in a list,

I have a list "Task", in which I have used a Lookup column from another list "Project". 

 

 

List Task example - 

ID  Project     TaskDescription

1    PRJ001    Add a combo box

2    PRJ002    Add a table for showing leave data

 

List "Projects" example - 

ID    Projectcode  CompanyName 

1     PRJ001          QAIB

2     PRJ002          NASD

 

I am using the below code to insert it into the "Task" list 

Set(
isSubmitClicked,
true
);
If(
fTaskMain.Valid,
SubmitForm(fTaskMain);
Set(
LastInsertedTask,
fTaskMain.LastSubmit
);
RemoveIf(
TaskLogDetail,
TaskNo = Value(txtID.Text)
);
ForAll(
UserLog,
Patch(
TaskLogDetail,
Defaults(TaskLogDetail),
{
Comment: Comment,
Time: Value(Time),
Date: Date,
TaskNo: Value(LastInsertedTask.ID),
User: User
}
)
);
If(
Not(IsBlank(LastInsertedTask.ID)),
Notify(
"Saved Successfully !!.",
NotificationType.Success,
7
);

Clear(UserLog);
ResetForm(fTaskMain);
ResetForm(fLogDetail);
Set(
isSubmitClicked,
false
),
Notify(
"Some error occurred. Not able to save !!",
NotificationType.Warning,
7
)
);
,
Notify(
"Mandatory fields can not be blank.",
NotificationType.Error,
7
)
);

 

 

Categories:
I have the same question (0)
  • JohnM86 Profile Picture
    590 on at

     

    Based on the information you provided, it seems like the issue might be related to how you set the "Project" column in the "Task" list.

     

    You mentioned that the "Project" column in the "Task" list is a lookup column from the "Projects" list. To set the "Project" column in the "Task" list, you need to provide the ID of the selected project from the "Projects" list.

     

    Assuming that the "Project" column in the "Task" list is named "Project" and the combo box in your form is named "cmbProject", you can set the "Project" column in the "Task" list like this:

     

     
    Patch( Task, Defaults(Task), { Project: Lookup( Projects, Projectcode = cmbProject.Selected.Projectcode, ID ), TaskDescription: txtTaskDescription.Text } )
  • KiDev27 Profile Picture
    10 on at

    As the above code mentioned, I am already using "SubmitForm" to insert an item in the list.

    If I write this code 

    Patch( Task, Defaults(Task), { Project: Lookup( Projects, Projectcode = cmbProject.Selected.Projectcode, ID ), TaskDescription: txtTaskDescription.Text } )

     

    will it work only for the latest row inserted in the list.

  • JohnM86 Profile Picture
    590 on at

     

    If you want to update the latest row only, you need to use a different function to find the record to update. One way to do this is to use the Last function to find the last record in the data source, like this:

     

     
    Patch(Task, Last(Task), { Project: Lookup(Projects, Projectcode = cmbProject.Selected.Projectcode, ID), TaskDescription: txtTaskDescription.Text })
     

    In this formula, the Last function returns the last record in the Task data source. The Patch function then updates the Project and TaskDescription fields of this record.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard