如何查询Salesforce对象以仅返回特定字段(列)?

时间:2017-05-01 15:59:09

标签: powerquery

我与Salesforce建立了连接。选择了具有100个字段的Account对象(我们已经最大化了允许的字段数)。这会出现以下错误(请求的URI太长)。

这适用于较小的表格。

有没有办法创建一个只选择我想要的字段(列)的自定义查询?通过修改自动生成的查询:

-- Lib.hs    
module Lib
  ( someFunc
  , F(..)
  ) where

newtype F a = F (a -> Double)
type F' a = a -> Double

someFunc :: Double -> Double -> F Double
someFunc a b = F (\x -> someFunc' a b x)

someFunc' :: Double -> Double -> F' Double
someFunc' a b x = a * x + b

-- Main.hs
module Main where

import Prelude
import Data.Monoid ((<>))
import Lib

foo :: Double -> F Double
foo x = someFunc 1.0 2.0

inspectFoo :: F Double -> String
inspectFoo (F x) = "F(" <> show x <> ")"

main :: IO ()
main = print . inspectFoo $ foo 2.0

或者修改发送给Salesforce的实际SOQL请求?

这是错误

let
    Source = Salesforce.Data("[salesforce URL]", [CreateNavigationProperties = true]),
    Account1 = Source{[Name="Account"]}[Data]
in
    Account1

1 个答案:

答案 0 :(得分:0)

Table.SelectColumns应折叠为Salesforce,请查看是否有效:

let
    Source = Salesforce.Data("[salesforce URL]", [CreateNavigationProperties = true]),
    Account1 = Source{[Name="Account"]}[Data],
    Account2 = Table.SelectColumns(Account1, { "First Column", "Second Column" })
in
    Account2
相关问题