Skip to content

Conversation

@aadamgough
Copy link
Contributor

Summary

Added create list items.

Type of Change

  • Other: improvment

Testing

See video

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Screen.Recording.2025-09-18.at.1.39.12.PM.mov

Adam Gough added 2 commits September 18, 2025 13:35
(cherry picked from commit df6ea35)
@vercel
Copy link

vercel bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Sep 18, 2025 9:19pm
sim Error Error Sep 18, 2025 9:19pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR adds a new SharePoint tool for creating list items, expanding the existing SharePoint integration to support adding individual items to SharePoint lists through Microsoft Graph API. The implementation introduces sharepointAddListItemTool which is distinct from the existing createListTool - while the latter creates entire SharePoint lists, this new tool adds data items to existing lists.

The change follows established patterns throughout the codebase:

  • Tool Implementation: The new add_list_items.ts tool uses OAuth authentication, includes comprehensive parameter validation, and implements read-only field filtering to prevent system fields from being included in creation requests
  • Type Safety: A new SharepointAddListItemResponse interface is added to maintain TypeScript safety, following the same pattern as other SharePoint response types
  • Registry Integration: The tool is properly registered in the tools registry as sharepoint_add_list_items, maintaining consistency with the naming convention
  • Block UI Integration: The SharePoint block is updated to include an 'Add List Items' operation in the dropdown, reusing existing field handling logic while properly distinguishing between creating new items (no itemId required) and updating existing ones

The tool supports flexible input formats (both {fields: {...}} and direct {fieldName: value} structures), includes robust error handling, and provides comprehensive logging for debugging. This completes the CRUD operations for SharePoint list management within the platform's workflow system.

Confidence score: 4/5

  • This PR appears safe to merge with comprehensive implementation following established patterns
  • Score reflects well-structured code with proper error handling and type safety, though complex field validation logic needs attention
  • Pay close attention to the field handling logic in add_list_items.ts lines 72-122 for potential edge cases

5 files reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

params.listItemFields !== null &&
'fields' in (params.listItemFields as Record<string, unknown>) &&
Object.keys(params.listItemFields as Record<string, unknown>).length === 1
? ((params.listItemFields as any).fields as Record<string, unknown>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Type assertion to any should be avoided. Consider defining a proper type for the fields structure.

Context Used: Context - Avoid using type assertions to 'any' in TypeScript. Instead, ensure proper type definitions are used to maintain type safety. (link)

},

transformResponse: async (response: Response, params) => {
let data: any
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Type assertion to any should be avoided. Define a proper interface for the Graph API response.

Context Used: Context - Avoid using type assertions to 'any' in TypeScript. Instead, ensure proper type definitions are used to maintain type safety. (link)

throw new Error('No fields provided to create the SharePoint list item')
}

const readOnlyFields = new Set<string>([
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did you get these?

@waleedlatif1 waleedlatif1 merged commit 7327b44 into staging Sep 18, 2025
5 of 6 checks passed
@waleedlatif1 waleedlatif1 mentioned this pull request Sep 18, 2025
10 tasks
Acumen-Desktop pushed a commit to Acumen-Desktop/sim that referenced this pull request Sep 20, 2025
…t from create list (simstudioai#1379)

* added add list items

(cherry picked from commit df6ea35)

* bun run lint

* minor changes

---------

Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Co-authored-by: Adam Gough <adamgough@Adams-MacBook-Pro.local>
@waleedlatif1 waleedlatif1 deleted the improvement/sharepoint branch September 25, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants