Hi
I am trying to update a record on different list but the updating list field 'Business Name' is text also same time to Patch a new record to another list SharePoint, where one of the columns Company in SharePoint is a Look Up field.
Using the code below, only patches when I hard code the lookup field which is Company.Value
Not sure what I am missing.
Company: {
Id: 961, // I have to hard code to get correct person name
Value: varFormDataChecks.'Business Name'
}
This is the Lookup Field i am having trouble to patch
UpdateIf(
'Check Management',
ID = varFormDataChecks.ID,
{amount: varFormDataChecks.amount - Value(txtAmountPay.Text)}
);
UpdateIf(
'Check Management',
amount = Value(0),
{
amount: Value(0),
Status: {Value: "Close"}
}
);
/*Updating another List (Company Feild is a .Value Lookup in the back End)*/
Patch(
'Loan Management',
Defaults('Loan Management'),
{
Notes: txtCommentPay.Text,
LoanRequestedDate: datePickerPay.SelectedDate,
LoanAmount: Value(txtAmountPay.Text),
Company: {
Id: 961, // I have to hard code to get correct person name
Value: varFormDataChecks.'Business Name'
}, // This list company is .Value in back end sharepoint
LoanDueDate: Now(),
'Invoice Number': txtRefNoPay.Text,
Balance: Value(TextInput4_18.Text),
CompanyName: varFormDataChecks.'Business Name'
}
);
Solved! Go to Solution.
yes its possible like this "Mycolumn.Text" to other filed "MyCloumn2.Text"
Here is the full code incase someone else needed
Patch(
'Loan Management',
Defaults('Loan Management'),
{
Notes: txtCommentPay.Text,
LoanRequestedDate: datePickerPay.SelectedDate,
LoanAmount: Value(txtAmountPay.Text),
Company: {
Id:LookUp(Customers,Company = varFormDataChecks.'Business Name').ID,
Value: Text(varFormDataChecks.'Business Name')
},
LoanDueDate: Now(),
'Invoice Number': txtRefNoPay.Text,
Balance: Value(TextInput4_18.Text),
CompanyName: varFormDataChecks.'Business Name'
}
)
I lookup the main Parent Customers list which is different than the one I was looking
Company: {
Id:LookUp(Customers,Company = varFormDataChecks.'Business Name').ID,
Value: Text(varFormDataChecks.'Business Name')
},
I will mark also this one as is got full code
you can use " 'My Lookup Column'.Id "
Is it possible as the one i would like to copy from is text field to Lookup field on other list ?
yes its possible like this "Mycolumn.Text" to other filed "MyCloumn2.Text"
Here is the full code incase someone else needed
Patch(
'Loan Management',
Defaults('Loan Management'),
{
Notes: txtCommentPay.Text,
LoanRequestedDate: datePickerPay.SelectedDate,
LoanAmount: Value(txtAmountPay.Text),
Company: {
Id:LookUp(Customers,Company = varFormDataChecks.'Business Name').ID,
Value: Text(varFormDataChecks.'Business Name')
},
LoanDueDate: Now(),
'Invoice Number': txtRefNoPay.Text,
Balance: Value(TextInput4_18.Text),
CompanyName: varFormDataChecks.'Business Name'
}
)
I lookup the main Parent Customers list which is different than the one I was looking
Company: {
Id:LookUp(Customers,Company = varFormDataChecks.'Business Name').ID,
Value: Text(varFormDataChecks.'Business Name')
},
I will mark also this one as is got full code
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
182 | |
52 | |
41 | |
40 | |
34 |
User | Count |
---|---|
251 | |
81 | |
71 | |
66 | |
66 |