通过REST无法工作,从SharePoint Web服务获取用户信息



当前情况:我正在使用SharePoint Web服务调用" getListItems "从SharePoint列表中检索数据。

不幸的是,我有多个类型人的列列。他们只显示该人的名字,但我也想检索该人的电子邮件地址。

我找到了这个:

<QueryOptions><ExpandUserField>TRUE</ExpandUserField></QueryOptions>

并在此处插入:

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
        <GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
            <listName>blahblah</listName>
            <query>
                <Query>
                    <Where>
                        <And>
                            <Eq>
                                <FieldRef Name='result' />
                                <Value Type="Text">Relationship declined</Value>
                                </Eq>
                            <Eq>
                                <FieldRef Name='Tracking_x0020_performed' />
                                <Value Type="Text">Open</Value>
                            </Eq>
                        </And>
                    </Where>
                  <QueryOptions><ExpandUserField>TRUE</ExpandUserField></QueryOptions>
                </Query>
            </query>
            <viewFields>
                <ViewFields xmlns="">   </ViewFields>
            </viewFields>
            <rowLimit>5000</rowLimit>    
        </GetListItems>
    </soap12:Body>
</soap12:Envelope>

我没有在我的响应XML中获得有关人型字段的任何特定额外信息,只是SP列表中的字段。

那么,如何从人类类型字段中检索电子邮件等?正如我说的那样,我只是得到他们的显示名称。

我自己解决了。

对于所有有兴趣的人,这是正确的方法:

<queryOptions>
   <QueryOptions>
      <ExpandUserField>TRUE</ExpandUserField>
   </QueryOptions>
</queryOptions>

加上它必须低于" getListItems"级别 - 因此与" listName"one_answers" Query"one_answers" Query"

相同的级别

相关内容

最新更新