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 Automate / Power automate desktop...
Power Automate
Unanswered

Power automate desktop excel as database

(0) ShareShare
ReportReport
Posted on by 47

 

we have multiple invoice transaction with line type bases of catalog and non catalog item then each catalog and non catalog item have respective invoice line number series, sometime po line number available with similar number to map respective catalog items.

 

venkatesh340789_2-1706193715971.png

we are looking to get each catalog and non catalog item line update separately and map respective CGST and IGST value in single row.

 

I have got SQL Code to resolve this issue but getting error will run sql database in power automate desktop

 

venkatesh340789_0-1706193960917.png

 

I have the same question (0)
  • venkatesh340789 Profile Picture
    47 on at

    @UshaJyothi20  

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    hi @venkatesh340789 

    could you please tell me for what you need to write query and please share what query you have written 

  • venkatesh340789 Profile Picture
    47 on at

     

     

    with cte as (
      select *, sum(case when LineType in ('Non-Catalog Item', 'Catalog Item') then 1 else 0 end
                over (partition by InvoiceID order by InvoiceNumber) as grp,
                case when LineType in ('Non-Catalog Item', 'Catalog Item') then 1 else 0 end as catalog_flag
      from [SQL Test$]
    )
    select InvoiceID, max(case when catalog_flag = 1 then LineType end) as LineType, 
                      max(case when catalog_flag = 1 then InvoiceNumber end) as InvoiceNumber, 
                      sum(case when catalog_flag = 1 then sum end ) as Amount,
                      sum(case when LineType = 'IGST' then sum end ) as IGST,
                      sum(case when LineType = 'CGST' then sum end ) as CGST
    from cte c
    group by InvoiceID, grp

     

    venkatesh340789_0-1706367346691.png

     

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Do one thing wherever you need to use coloumn name use inside square brackets and inside that coloumn name 

    Please try it 

     

  • venkatesh340789 Profile Picture
    47 on at

    venkatesh340789_0-1706368159925.png

     

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    need to use [column name]

    as shown belo

    and please share your sql query

    after updating [column name]

  • venkatesh340789 Profile Picture
    47 on at

    SheetName: SQL Test

    I have updated Table Source in Below Table.  

     

    InvoiceIDLineTypeInvoiceNumber[PO] Line TypePOSum
    000002172352852-611932Non-Catalog Item1  51,940.00
    000002172352852-611932CGST2  0
    000002172352852-611932SGST3  0
    0001-569052Non-Catalog Item1  13,41,400.00
    0001-569052IGST2  0
    0001-569052Non-Catalog Item3  6,70,700.00
    0001-569052IGST4  0
    0001-569052Non-Catalog Item5  2,000.00
    0001-569052IGST6  0
    0001-569052Non-Catalog Item7  1,000.00
    0001-569052IGST8  0
    01/2023-24-588032Non-Catalog Item1  29,660.00
    01/2023-24-588032IGST2  5,338.80
    01-600214Non-Catalog Item1Non-Catalog Item111,700.00
    01-600214CGST2Non-Catalog Item10
    050-601011Non-Catalog Item1Non-Catalog Item141,500.00
    050-601011IGST2Non-Catalog Item10
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Hi @venkatesh340789 

    Could you please try the process by removing [] in the header  name [PO] Line Type

    and then try please

     

    and i am trying to do by using run .net action

    once completed i will update you

     

  • venkatesh340789 Profile Picture
    47 on at

    it is not working after removed square brackets. 

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    SQL queries to Excel are limited in their functionality. You will not be allowed to do CTEs or similar things there. They only support simple queries.

     

    Instead, read the entire table and apply the appropriate filtering in the flow logic, by either using a .NET script, or simply native Excel actions.

    Or, alternatively, push the data to an actual database first, and then do proper SQL queries to it.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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 Automate

#1
David_MA Profile Picture

David_MA 271 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 171 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 148 Super User 2026 Season 2

Last 30 days Overall leaderboard