I am trying to create my first power apps application with 2 sql server connected tables

232 views Asked by At

I am trying to create my first power apps application with sql server connected tables I have most of it finished and doing what I want it to do. Just need to finish the last part. so the first screen shows all of the customers in a browser gallery. they click on the customer then that take them to a details page that shows customer information like customer ID I then have a button for them to click that will take them to the Quote form and populate that form with the customerID as a global variable. On this form page I have the customer ID field pre populated with the global variable. I have begin date End Date, and filter. When they click search button I am taking them to another page like quotedetails passing in all of that information as global variables

Navigate(
    QuoteResult,
    ScreenTransition.Cover,
    {
        BeginDate: BeginDate.SelectedDate,
        EndDate: EndDate.SelectedDate,
        filtertext: FilterDropDown.Selected.Value,
        CustIdText: CustText.Text
    })

on this last page I want to show only certain columns but filter it like a where statement

I have something like this

LookUp(
    '[dbo].[SOHeader]',
    CpnyID = "AOS" &&
        LUpd_DateTime >= BeginDate &&
        LUpd_DateTime <= EndDate &&
        SOTypeID = filtertext &&
        CustID = CustIdText)

then how would I tell it what particular columns I want from this table also

of course it is not working any help would be appreciated

the sql query to accomplish this would look something like this

SELECT   distinct SOHeader.OrdNbr, soheader.sotypeid, soheader.user6, SOheader.LUpd_DateTime, SOHeader.User3, soheader.crtd_user, SOHeader.S4Future01, SOHeader.SlsperID, SOHeader.TotMerch, SOHeader.CustOrdNbr 
FROM SOHeader 
WHERE (SOHeader.SOtypeID = 'SO'  AND SOHeader.Lupd_DateTime >= '5/16/2017'  AND SOHeader.lupd_DateTime <= '8/14/2017'  AND soheader.CpnyID = 'AOS'   and soheader.custid = 'LOCKT001')
1

There are 1 answers

0
josh On

I figured this out with using filter instead of lookup

Filter('[dbo].[SOHeader]',CpnyID = "AOS", CustID = CustIdText)

I decided to take out some columns while like the dates so I know I would get data