Skip to main content

Notifications

Power Apps Pro Dev & ISV
Suggested answer

Patch function for creating items at Sharpoint with lookUp Columns ins returning nothing.

Posted on by 21
Hi everyone,

I'm working on a SharePoint app where I need to mass upload data from one list (List B) into another SharePoint list (List A).
The challenge I'm facing is that List A has two lookup columns, while the corresponding data in List B is in text format. 
 
To give some context:
- List A is the target list where the data will be stored.
- List B is the source list containing text fields for "Customer Code" and "Product Code."
- I need to map these text fields from List B to the lookup fields in List A.
There are 1,047 records to transfer, so theoretically, it could be a simple copy-paste job, but I know that's not possible in SharePoint. 
In summary, my goal is to match and transfer the "Customer Code" and "Product Code" from List B into the corresponding lookup columns in List A, which will serve as the database for my app.
 
Let me know if you need more details or adjustments!
My current code
 
ForAll(
    Patch(
        SalesAPP_Oportunidades;
        Defaults(SalesAPP_Oportunidades);
        {
            Company: ThisRecord.Company;
            DeliveryDate: ThisRecord.Date_C;
            Stage: {Value: ThisRecord.Status};
            Volume: Value(ThisRecord.'Soma de Units');
            SalesPrice: Value(ThisRecord.'USD Net Price');
            UFCustormer: ThisRecord.UF;
            CustomerListCode: {
                Id:ThisRecord.ID_Cliente;
                Value: ThisRecord.SAP_Customer
            };
            ProductListCode: {
                Id: ThisRecord.ID_produto;
                Value: ThisRecord.SAP_Product
            }
        }
    )
)
 
Thank you so much!
  • gpcamillo Profile Picture
    gpcamillo 21 on at
    Patch function for creating items at Sharpoint with lookUp Columns ins returning nothing.
    FLMike, thank you. 
    See if the post is better to understand now, please?
  • Suggested answer
    gpcamillo Profile Picture
    gpcamillo 21 on at
    Patch function for creating items at Sharpoint with lookUp Columns ins returning nothing.
    Hi,
     
    You show us trying to do a lookup but what property were you even trying to map that too?
     
    Your details are disjointed. 
    Sorry about that
     
    Explain what you are trying to patch, the Data types for each and then show us the error.
    I'm trying to Patch 2 Text Columns to 2 LookUp Columns at sharepoint, making 2 filters (customer code and company name)
    My table have 1047 items.

     
    If you want to patch a lookup, then you need to pass it a record in that place , I don't see you doing that anywhere and the lookup is confusing, and btw there is no reasons you cannot use ThisRecord in a lookever, but again you aren't showing all your code, share more.
    Thank you for the information. Did you have some good exemple to share?
  • Suggested answer
    FLMike Profile Picture
    FLMike 28,123 on at
    Patch function for creating items at Sharpoint with lookUp Columns ins returning nothing.
    Hi,
     
    You show us trying to do a lookup but what property were you even trying to map that too?
     
    Your details are disjointed.
     
    Explain what you are trying to patch, the Data types for each and then show us the error.
     
    If you want to patch a lookup, then you need to pass it a record in that place, I don't see you doing that anywhere and the lookup is confusing, and btw there is no reasons you cannot use ThisRecord in a lookever, but again you aren't showing all your code, share more.

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Tuesday Tip #1 Subscribing to Forums…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,450

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,467

Leaderboard