Forum Discussion

keithkelly's avatar
2 years ago

BS Session: Architect a "Department" field (bonus: weekly batch update)

Help me brainstorm:  Our users want to see a other users' departments listed beside their name with each post ( Sue [Engineering] )

The primary focus of this thread is to brainstorm easy ways to batch update a custom "department" field either automatically/weekly, or on-demand with the click of a button.

Assumptions: 

  • Khoros Support would create a custom "dc_dept" string field for user objects.

Notes/Details:

  • We have Azure at our fingertips, buuuuttttt spinning up machines always seems to be expensive so I'm OK with alternatives - even if it's a local Postman / Python thing I run manually as needed.
  • Azure Active Directory contains the up-to-date Departments, but very soon we'll have this available in Snowflake. (I heard something about a Khoros-Snowflake connector in the works somewhere)

What I Have Already (in case it helps w/ a short-term solution):  A Magic Workbook:

The workbook already has the users/department mappings, and I pull this data weekly using PowerBI connections to The Pond (our Khoros Community) and AzureAD. 

...

So...the questions!

In the short-term, I could easily convert the User/Dept to a CSV or JSON file to use with ________? How would you push the data to Khoros?  Postman collection runner?  Python jingamathig? 

In the long-term, something automatic to skip the Excel workbook would be desirable.  Any ideas there? 

...

No need for a full solution here - but I'd appreciate any pointers as to where to start digging. 

  • Ooh, interesting & great ideas & warnings.  Thanks for the guidance!

  • My ideas:
    1. Create a component to write to user profile, all data in json, make pagination out of it, connect with javascript, click "Begin", go on vacation. Or do daily batches.

    2. Or, make JS when user opens a page, lets say a forum article page, to take all users from page and write to their profiles so you don't have to do it (doing it only when user logs in is very slow process).

    3. No matter what route you go, you still need to have title update once user logs in. You can achieve that activity.results.name.UserSignedOn.

    Bonus: be careful making too many db calls otherwise Khoros will go into your production instance and comment out the code if in custom content xD

  • MattV's avatar
    MattV
    Khoros Staff

    Best long-term solution would be to pass the title over with SSO, so then it's updated at every login.

    2nd best option, would be if you could spin up that Azure instance, and then when a user logs in, you could make an API call that fetches the users latest title and update their profile. 

    If you intend to push manual updates, I would certainly try to filter by users who's titles have changed. Otherwise, if you have a lot of users, these updates could take a really long time, and bog down the server. It could also be expensive with the number of API calls.

    You may want to create a custom endpoint that you can call and pass in a batch of user ids and title, and have it chug on a handful of users at a time.