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 / importing a sharepoint...
Power Apps
Answered

importing a sharepoint list to sql server

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm trying to import a list from sharepoint to sql server:

This code is not giving me an error, but it also is not working ?

 

ForAll(
t_PA_Excel_Sku_Export_Import,
Collect(
'[dbo].[t_pricing_escalation_detail_temp]',
{
SKU: SKU,
RBP_MASTER_ID: Value(RBP_MASTER_ID),
RENEWAL_SKU: RENEWAL_SKU,
RENEWAL_OLVP_QUOTENUMBER: RENEWAL_OLVP_QUOTENUMBER,
PRODUCT_DESCRIPTION: PRODUCT_DESCRIPTION,
QTY: Value(QTY),
TARGET_PRICE: Value(TARGET_PRICE),
TARGET_GP: Value(TARGET_GP),
CURRENT_PRICE: Value(CURRENT_PRICE),
VENDOR_GUIDELINE_GP: Value(VENDOR_GUIDELINE_GP),
APPROVED_PRICE: Value(APPROVED_PRICE),
APPROVED_GP: Value(APPROVED_GP),
SEND_TO_LEADER: SEND_TO_LEADER,
PANDEMIC_SKU: PANDEMIC_SKU
}
)
)

 

Thanks

Dave

Categories:
I have the same question (0)
  • Carlosr Profile Picture
    Microsoft Employee on at

    Use Patch, not Collect.  Collect is for in-memory collections.  Patch will actually write to the data source.  The defaults parameter fills in any missing fields with a default value.

    Patch(
    '[dbo].[t_pricing_escalation_detail_temp]',

    Defaults('[dbo].[t_pricing_escalation_detail_temp]'),
    {
    SKU: SKU,
    RBP_MASTER_ID: Value(RBP_MASTER_ID),
    RENEWAL_SKU: RENEWAL_SKU,
    RENEWAL_OLVP_QUOTENUMBER: RENEWAL_OLVP_QUOTENUMBER,
    PRODUCT_DESCRIPTION: PRODUCT_DESCRIPTION,
    QTY: Value(QTY),
    TARGET_PRICE: Value(TARGET_PRICE),
    TARGET_GP: Value(TARGET_GP),
    CURRENT_PRICE: Value(CURRENT_PRICE),
    VENDOR_GUIDELINE_GP: Value(VENDOR_GUIDELINE_GP),
    APPROVED_PRICE: Value(APPROVED_PRICE),
    APPROVED_GP: Value(APPROVED_GP),
    SEND_TO_LEADER: SEND_TO_LEADER,
    PANDEMIC_SKU: PANDEMIC_SKU
    })

  • Abhilash_Swain Profile Picture
    901 on at

    Please use MS flow to run the query to insert items into databse.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    carloser,

    I'm trying to take this sharepoint file  "t_PA_Excel_Sku_Export_Import" 

     

    and insert it into the sql server file "[dbo].[t_pricing_escalation_detail_temp]'" ?

     

  • Verified answer
    Carlosr Profile Picture
    Microsoft Employee on at

    To use power fx, just add your ForAll statement to my sample:
    ForAll(
    t_PA_Excel_Sku_Export_Import,

    Patch(
    '[dbo].[t_pricing_escalation_detail_temp]',

    Defaults('[dbo].[t_pricing_escalation_detail_temp]'),
    {
    SKU: SKU,
    RBP_MASTER_ID: Value(RBP_MASTER_ID),
    RENEWAL_SKU: RENEWAL_SKU,
    RENEWAL_OLVP_QUOTENUMBER: RENEWAL_OLVP_QUOTENUMBER,
    PRODUCT_DESCRIPTION: PRODUCT_DESCRIPTION,
    QTY: Value(QTY),
    TARGET_PRICE: Value(TARGET_PRICE),
    TARGET_GP: Value(TARGET_GP),
    CURRENT_PRICE: Value(CURRENT_PRICE),
    VENDOR_GUIDELINE_GP: Value(VENDOR_GUIDELINE_GP),
    APPROVED_PRICE: Value(APPROVED_PRICE),
    APPROVED_GP: Value(APPROVED_GP),
    SEND_TO_LEADER: SEND_TO_LEADER,
    PANDEMIC_SKU: PANDEMIC_SKU
    }))

     

    If this is a one time thing, then Power Automate might be better.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard