6

Click here to load reader

Field Data Integrators Anoto SharePoint Online Connection Configuration ·  · 2017-07-08Field Data Integrators Anoto SharePoint Online Connection Configuration Introduction

  • Upload
    donhu

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Field Data Integrators Anoto SharePoint Online Connection Configuration ·  · 2017-07-08Field Data Integrators Anoto SharePoint Online Connection Configuration Introduction

FieldDataIntegratorsLLCsupport@FieldDataIntegrators.comwww.FieldDataIntegrators.com

1

FieldDataIntegratorsAnotoSharePointOnlineConnectionConfiguration

Introduction TheFieldDataIntegrators(FDI)ConnectionmakesitpossibleforusersoftheAnotoLiveForms(ALF)datacollectionplatformtoarchiveformscollectedondigitalpaperandtabletsdirectlyintoSharePointOnline.Thiscapability,partofthebroaderFDIAutomation,offersPowerUserstheabilitytoconfiguretheirsystemstoachievecommonintegrationscenarios:

- Store PDF versions of forms (either the ink or the text converted versions), into SharePoint Online Document Libraries

- Automatically populate SharePoint columns with metadata extracted from form fields, including support for Custom Content Types

- Archive form data content in XML or CSV formats, as well as form attachments such as images taken on mobile devices or other attachments

One time app registration InordertobeabletoaccessSharePoint,theFDIAutomationcomponentneedstoberegisteredandauthorized.Registertheaddin

Startbyregisteringandaddinbyvisitingthefollowingpageonabrowser.Replaceyour.sharepoint.comwithyourSharePointserver’sURL:https://your.sharepoint.com/_layouts/15/AppRegNew.aspxFillouttheregistration:

- Client Id – use the Generate button to create one automatically - Client Secret - use the Generate button to create one automatically - Title – use “Field Data Integrators Anoto Conector” or other suitable name to

identify the app - App domain – enter the URL of the Anoto Live Forms server - Redirect URI – enter the URL of the Anoto LiveForms server followed by “/sp-

oauth-redir.php”. This is the address of the service that will handle the authorization tokens and store them for future access to the SharePoint site

- Select Create

Page 2: Field Data Integrators Anoto SharePoint Online Connection Configuration ·  · 2017-07-08Field Data Integrators Anoto SharePoint Online Connection Configuration Introduction

2

Successfulcreationwillresultinamessagesimilartotheonebelow,exceptthatthedomainandredirectURIlistedwillbetheonesinformedintheregistrationabove:

The app identifier has been successfully created. ClientId: 60c82f5e-c799-4fa1-b0b7-b056df289b03ClientSecret:DSYzRi1VwoOxUioq6V8cJ0kVNkRElswbxT4Hnx6RQbs=Title: FieldDataIntegratorsAnotoConnectorAppDomain:your.anotoserver.comRedirectURI:https://your.anotoserver.com/sp-oauth-redir.php

Authorizeaccess

LogintotheSharePointsiteusingcredentialswithpermissiontoauthorizeaddins,replacingthesharepointsite,clientid,clientsecretandredirectURIwiththeonesusedduringtheregistrationstepabove: https://your.sharepoint.com/_layouts/15/oauthauthorize.aspx?client_id=<client id>&scope=Web.Read+Web.Write&response_type=code&redirect_uri=your.anotoserver.com/sp-oauth-redir.php&client_secret=<client_secret>

Page 3: Field Data Integrators Anoto SharePoint Online Connection Configuration ·  · 2017-07-08Field Data Integrators Anoto SharePoint Online Connection Configuration Introduction

3

Select“TrustIt”whenpresentedwiththedialogconfirmingtheauthorization.Successfulauthorizationresultsinamessagesimilartothefollowing:

FieldDataIntegratorsAnotoConnectionOAuthAuthorizationParameterList

client_id <clientid>scope Web.WriteWeb.ReadWeb.Manageresponse_typecoderedirect_uri https://your.anotoserver.com/sp-oauth-redirect.php

client_secret <clientsecret>realmguid <automaticallyretrieved>

AuthorizationSuccessfull

SuccessfullystoredSharePointaccesstokens Oncethisprocessisdone,itonlyneedstoberepeatediftheauthorizationlapses,whichmayhappenevery6months,dependingontheSharePointadminconfiguration.Archiving action configuration ToconfigureanewformorchangethebehaviorofanexistingconfigurationsothatformdataisarchivedintoSharePoint,configuretheFormSyncSPactionparametersasdescribednext.Determinethemapping

StartbydeterminingwhichSharePointmetadatacolumnsaretobepopulatedwithformfields.Foreachoftheselectedcolumns,determinethefieldsoftheformthatcontainthecorrespondingvalues.

Page 4: Field Data Integrators Anoto SharePoint Online Connection Configuration ·  · 2017-07-08Field Data Integrators Anoto SharePoint Online Connection Configuration Introduction

4

DeterminetheLibrariesandFolders

TheFDISharePointOnlineConnectorcanbeconfiguredtoaddresstwoprimaryscenarios:1) Each form type is archived to a separate Document Library. In this case

additional metadata columns into which the form fields are to be mapped are created directly within the Library

2) Multiple forms are archived into a single Document Library. a. If all form types have the same metadata columns, these can be

simply created as in case 1) above. b. If the forms require different metadata columns, Custom Content

Types can be created for each (via Site Settings > Site Content Types > Create) and added to the Document Library. During configuration of the FDI Automation FormSyncSP action, the different Content Types are specified via the fieldmap parameter, as described in the next section.

ConfiguretheFormSyncSPAction

BackontheFDIAutomationeditor(https://my.alf.server/fdiforms/config.php)buildtheFormSyncSPActionparameters.Theparametersandallowedexpressionsaredescribednext.ActionparameterexpressionsMostoftheActionconfigurationparameterscantakeexpressionsthatmakereferencetoformfields.TheexpressionssupportoperatorsandsyntaxavailableinPHP.Thefollowinglistscommonones:Referencestoformfieldsandtodocument/formattributes

- Form field names are represented as $Field variables, e.g. “$WoNumber” - Document/form attributes are represented by $doc->attribute, where

attribute can be o $doc->id – unique numeric identifier of the form o $doc->name – name assigned to the form (may be customized by the

RenameDoc Action) o $doc->state – ‘NEW’, ‘OPEN or ‘COMPLETED’, depending on whether

the form was just uploaded, has been edited in the ALF Viewer, or marked Complete

Constants- Are enclosed in quotes, e.g. ‘1X’

Operatorsandfunctions

- Conditional o ‘==’ – equal o ‘!= - not equal o >, >=, <, <= - expected meanings o <cond> ? <value if true> : <value if false> - ternary operator, e.g.

($BillingCode == ‘B1’) ? $StandardRate : ’15.00’

Page 5: Field Data Integrators Anoto SharePoint Online Connection Configuration ·  · 2017-07-08Field Data Integrators Anoto SharePoint Online Connection Configuration Introduction

5

- Mathematical o ‘+’, ‘-‘, ‘*’ (multiply), ‘/’ (divide)

- String o ‘.’ – concatenation, e.g. ‘A’ . $Field o strtoupper() – convert string to uppercase, e.g. strtoupper($Field) o strtolower() – convert string to lowercase, e.g. strtolower($Field)

- Salesforce o sfLooukup(<key value>, <objectname>, <key name>, <selected

field>), e.g. sfdcLookup($CompanyName, 'Account', 'Name', 'Id') ActionconfigurationFillouttheconfigurationparametersasfollows.“targetbase” SharePointOnlineDocumentLibraryintowhichformsarearchived,replacing

ORG,SITEandDOCLIBbyyourorganization’sdomain,sub-sitewithinthedomain,ifany,andthenameoftheDocumentLibraryrespectivelly:'https://ORG.sharepoint.com/SITE/DOCLIB'

“condition” Conditionalexpressionthatneedstobetruefortheactiontobeexecuted,e.g.

$doc->state=='COMPLETED'Ifomitted,theactionisalwaysexecuted(defaultstotrue)

“fieldmap” '|'-separatedlistof'key'=>'value'pairswherethekeyisthenameofa

SharePointmetadatacolumnandthevalueisatransformexpressionusedtodetermineitscontents,e.g.“Title=>$doc->name”or“CaseNumber=>$CaseNo”.IftheDocumentLibraryhousesdocumentswithmultiplecontenttypes,includethefollowingkeysinthemap,whereCONTENT_TYPE_NAMEandCONTENT_TYPE_ID1matchthedesiredContentType:

|ContentType=>"CONTENT_TYPE_NAME"|ContentTypeId=>"CONTENT_TYPE_ID"'

“reqfields” '|'-separatedlistofnamesofthefieldsthatmustbenotemptyinorderfora

formtobearchived.Theseusuallyaremandatorymandatorymetadatafieldswithoutwhichtheformshouldnotbearchived.

Ifoneormoreoftherequiredfieldsareempty,theformisnotarchived,orifithasbeenpreviouslyarchived,thefilesareremoved.

1TheIdcanbeextractedfromtheURLdisplayedbyvisitingSiteSettings>SiteContentTypesandselectingthespecifictype.TheIdisdisplayedasthectypeparameterintheURL,e.g.https://fdiforms.sharepoint.com/sites/dev/_layouts/15/ManageContentType.aspx?ctype=0x010100609A72A35F67204085BE20EF7B739D80

Page 6: Field Data Integrators Anoto SharePoint Online Connection Configuration ·  · 2017-07-08Field Data Integrators Anoto SharePoint Online Connection Configuration Introduction

6

NOTE:sinceformsmayberemovedfromSharePointifafieldisclearedout,thisparameterneedstobehandledwithcare.Considerusingthe“condition”parameterinstead,whichallowsforcontroloverwhenthearchivalactionistriggered,butdoesnotcauseremovalincasetheconditionisnotmet.

“filetype” '|'-separatedlistoftypes:"pdfink","pdftext","xml","csv","attachments"

Thetype“attachments”representsthephotosandotherfilesthatareassociatedwithaforminstanceviathemobileapportheViewer.

“filename” '|'-separatedlistofnamestoassigntoeachfiletype.Ifnotgiven,thenameof

theform/documentisused,withpdf,_text.pdf,xmlandcsvextensions.Ifasinglenameisgiven,itisusedforallfiles,varyingtheextensions,e.g."$project.'-'.$doc->id"couldgivethebaselinename,towhichtheextensionsarethenadded.AttachmentsmaintainthenameusersgavethemwhentheyuploadedviathemobileappsorintheViewer.

NOTE:Filesthatareplacedinthesamefolderneedtobeuniquelynamed,

otherwisetheymaygetoverwritten.Onewaytoguaranteethatistouse“$doc->id”aspartofthenameexpression.ThedocumentIdisalwaysguaranteedtobeuniqueacrossthewholeAnotoLiveFormsserver.

“folders” '|'-separatedlistoffoldersforeachtypeoffile;ifjustasingleexpressionis

provided,itisusedforalltypes.E.g.'/$Region/$Customer'or'/$Customer/PDF|/$Customer/XML'

Additional Resources Documentation,FAQsandotherguidescanbefoundontheFDIHelpCenterVersionHistoryDate Author Description Version08/17/2016 Barthelmess Initialdraft 1.007/07/2017 Barthelmess Addedaddinregistrationinformation 1.1