Upgrade to Pro — share decks privately, control downloads, hide ads and more …

start-salesforce-with-r

bk
September 19, 2020

 start-salesforce-with-r

bk

September 19, 2020
Tweet

More Decks by bk

Other Decks in Programming

Transcript

  1. RͰ࢝ΊΔSalesForce
    ʙsalesforcerʹΑΔSalesForceσʔλૢ࡞ʙ

    View full-size slide

  2. ໨࣍
    ૝ఆࢹௌऀͱ໨త……………………………………………………Q
    ࠓ೔࿩͞ͳ͍͜ͱ……………………………………………………Q
    SalesForceͱ͸………………………………………………………Qd
    salesforcerͱ͸………………………………………………………Qd
    ΦϒδΣΫτͱ͸……………………………………………………Qd
    SOQLͱ͸………………………………………………………………Qd
    Ϩϙʔτͱ͸……………………………………………………………Qd
    ࢀߟจݙ……………………………………………………………………Q
    salesforce

    View full-size slide

  3. ૝ఆࢹௌऀͱ໨త
    ໨త
    ૝ఆࢹௌऀ
    جຊ༻ޠʢΦϒδΣΫτɺSOQLʣ
    ΛRΛ௨ͯ͠ཧղ͢Δɻ
    • SalesForceΛ໊લ͔͠஌Βͳ͍
    • R͸࢖༻͍ͯ͠Δ
    • ϚʔέςΟϯάͱؔΘΓ͕͋Δ
    • GUIʹ௚઀৮Γͨ͘ͳ͍

    View full-size slide

  4. ߴ౓ͳ͜ͱ → ೖ໳ฤͳͷͰ
    ։ൃͷ͜ͱ → ҰൠϢʔβʔΛ૝ఆʢDeveloper Console͸ͪΐͬͱ࢖͏ʣ
    Ϩϙʔτܥ → ௐࠪෆ଍ͷͨΊʢεϥΠυ͸͋Δ͚Ͳؒҧ͍͋Δ͔΋ʣ
    ࠓ೔࿩͞ͳ͍͜ͱ

    View full-size slide

  5. SalesForceͱ͸
    salesforce

    View full-size slide

  6. SalesForceͱ͸
    Salesforce͸ɺاۀͱސ٬Λͭͳ͙ސ٬؅ཧιϦϡʔγϣϯɻϚʔέςΟϯάɺӦ
    ۀɺίϚʔεɺαʔϏεͳͲ͢΂ͯͷ෦ॺͰɺސ٬ҰਓͻͱΓͷ৘ใΛҰݩతʹڞ
    ༗Ͱ͖Δ౷߹CRMϓϥοτϑΥʔϜͰ͢ɻ
    https://www.salesforce.com/jp/products/what-is-salesforce/
    https://www.salesforce.com/campaign/worlds-number-one-CRM/

    View full-size slide

  7. https://www.salesforce.com/jp/hub/crm/what-is-crm/
    SalesForceͱ͸
    CRMͱ͸ʮCustomer Relationship ManagementʯͷུͰɺ೔ຊޠͰ͸ʮސ
    ٬ؔ܎؅ཧʯͱݺ͹Ε·͢ɻސ٬ͱͷؔ܎ੑɺίϛϡχέʔγϣϯΛ؅ཧ
    ͠ɺࣗࣾͷैۀһͱސ٬ͱͷؔ܎ΛҰݩతʹ೺ѲͰ͖ΔΑ͏ʹ͠·͢ɻ

    View full-size slide

  8. SalesForceͱ͸
    ຊ೔͸ແྉͰ৮ΕΔσϞΞΧ΢ϯτͰਐΊΔɻ
    https://developer.salesforce.com/signup

    View full-size slide

  9. SalesForceͱ͸
    σϞΞΧ΢ϯτొ࿥׬ྃޙͷτοϓϖʔδɻ

    View full-size slide

  10. Ͱ΍ͬͯΈΑ͏

    View full-size slide

  11. salesforcerͱ͸

    View full-size slide

  12. https://stevenmmortimer.github.io/salesforcer/index.html
    salesforcerͱ͸
    ϦϦʔε೔ɿ
    ࠷৽Ξοϓσʔτ೔ɿ
    ։ൃऀ໊ɿSteven M. Mortimer
    ʢݱࡏʣ
    RͰSalesForceΛૢ࡞Ͱ͖Δlibraryɻ

    View full-size slide

  13. salesforcerͱ͸
    or OAuth
    libraryΛΠϯετʔϧޙɺೝূ৘ใΛઃఆͯ͠઀ଓɻ
    Ϣʔβʔ໊ɺύεϫʔυɺηΩϡϦςΟτʔΫϯ͕ඞཁɻ
    ʢIP੍ݶֻ͕͔͍ͬͯΔͱηΩϡϦςΟτʔΫϯ͕औಘͰ͖ͳ͍ʣ

    View full-size slide

  14. sf_user_infoͰ઀ଓ৘ใͷ֬ೝɻlistܗࣜͰฦ͞ΕΔɻ
    salesforcerͱ͸

    View full-size slide

  15. ΦϒδΣΫτͱ͸

    View full-size slide

  16. ΦϒδΣΫτͱ͸
    ΦϒδΣΫτ ≒ ςʔϒϧ

    View full-size slide

  17. ΦϒδΣΫτͱ͸
    SalesForceͷ্෦ʹλϒঢ়ʹ͋Δɺͻͱͭͻͱ͕ͭΦϒδΣΫτɻ

    View full-size slide

  18. https://trailhead.salesforce.com/ja/content/learn/modules/lex_salesforce_basics/lex_salesforce_basics_welcome
    ΦϒδΣΫτͱ͸
    ΦϒδΣΫτʹ͸ॳΊ͔Β༻ҙ͞Ε͍ͯΔʮඪ४ΦϒδΣΫτʯͱɺϢʔ
    βʔ͕࡞੒͢ΔʮΧελϜΦϒδΣΫτʯ͕͋ΔɻԼͷਤ͸ඪ४ΦϒδΣΫ
    τͷҰ෦ɻ

    View full-size slide

  19. ͰΦϒδΣΫτҰཡΛऔಘ͢Δ

    View full-size slide

  20. ΦϒδΣΫτͱ͸
    sf_list_objectsͰऔಘɻlistܗࣜͰฦ͞ΕΔɻ

    View full-size slide

  21. Ͱ΍Δͱʁ
    salesforce

    View full-size slide

  22. ΦϒδΣΫτͱ͸
    ઃఆ͔ΒDeveloper ConsoleΛ։͘ɻ

    View full-size slide

  23. ΦϒδΣΫτͱ͸
    File͔ΒOpen ResourceΛ։͘ɻ

    View full-size slide

  24. ΦϒδΣΫτͱ͸
    ݕࡧ૭Ͱʮ.objʯͰऴΘΔ΋ͷΛݕࡧɻ

    View full-size slide

  25. SOQLͱ͸
    SOQLʢSalesforce Object Query Languageʣ

    SQLʢ*Structured Query Languageʣ
    *ANSIن֨ͷSQLͱ͍͏໊শ͸ެࣜʹ͸ԿͷུͰ΋ͳ͍ͱ͞ΕΔɻ
    http://e-words.jp/w/SQL.html

    View full-size slide

  26. ͰΦϒδΣΫτͷத਎Λऔಘ͢Δ

    View full-size slide

  27. SOQLͱ͸
    sf_queryʹจࣈྻΛ౉͢ɻFROMʹΦϒδΣΫτΛࢦఆɻ

    View full-size slide

  28. Ͱ΍Δͱʁ
    salesforce

    View full-size slide

  29. ઃఆ͔ΒDeveloper ConsoleΛ։͘ɻ
    SOQLͱ͸

    View full-size slide

  30. SOQLͱ͸
    Query EditorΛબ୒͠ɺΫΤϦΛهड़ɺExecuteΛԡ͢ɻ

    View full-size slide

  31. SOQLͱ͸
    தԝͷը໘ʹ݁Ռ͕දࣔ͞ΕΔɻ

    View full-size slide

  32. Ϩϙʔτͱ͸

    View full-size slide

  33. Ϩϙʔτͱ͸
    Ϩϙʔτ

    ΦϒδΣΫτΛूܭͨ͠΋ͷ

    View full-size slide

  34. Ϩϙʔτͱ͸
    τοϓϖʔδͷλϒʹଘࡏ͢Δɻ

    View full-size slide

  35. ͰϨϙʔτΛ࡞੒͢Δ

    View full-size slide

  36. Ϩϙʔτͱ͸
    sf_create_reportͰϕʔεͷϨϙʔτΛ࡞੒͔ͯ͠ΒɺϑΟϧλΛઃఆͯ͠
    sf_run_reportͰ࠶౓࡞੒͢Δɻ

    View full-size slide

  37. Ͱ΍Δͱʁ
    salesforce

    View full-size slide

  38. Ϩϙʔτͱ͸
    Ϩϙʔτը໘ͷNew Reportʢ৽نϨϙʔτʣΛ࣮ߦɻ

    View full-size slide

  39. Ϩϙʔτͱ͸
    ूܭର৅ͱͳΔΦϒδΣΫτΛબ୒ɻ

    View full-size slide

  40. Ϩϙʔτͱ͸
    FilterͰ৚݅Λઃఆɻ

    View full-size slide

  41. Ϩϙʔτͱ͸
    ूܭ݁Ռ͕ը໘தԝʹදࣔ͞ΕΔɻ

    View full-size slide

  42. ·ͱΊ
    SalesForceͱ͸
    salesforcerͱ͸
    ΦϒδΣΫτͱ͸
    SOQLͱ͸
    Ϩϙʔτͱ͸
    CRMϓϥοτϑΥʔϜ
    RͰSalesForceΛૢ࡞͢Δlibrary
    SalesForceͷςʔϒϧ
    SalesForceͷSQL
    ΦϒδΣΫτΛूܭͨ͠΋ͷ

    View full-size slide

  43. ɾTRAILHEAD
    https://trailhead.salesforce.com/ja/home
    ɾGitHub, ʮAn Implementation of Salesforce APIs Using Tidy Principles • salesforcerʯ
    https://stevenmmortimer.github.io/salesforcer/index.html
    ɾCRAN, ʮPackage salesforcerʯ
    https://cloud.r-project.org/web/packages/salesforcer/index.html
    ɾQiita, ʮΤϯδχΞͷͨΊͷsalesforce௒ೖ໳ʯ
    https://qiita.com/tarokamikaze/items/0bc2988534f63d4b65c5
    ࢀߟจݙ

    View full-size slide