Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify bookmark creation #40

Open
SeBBBe opened this issue Jan 22, 2019 · 1 comment
Open

Clarify bookmark creation #40

SeBBBe opened this issue Jan 22, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@SeBBBe
Copy link

SeBBBe commented Jan 22, 2019

Description

In the SDK, CreateBookmark accepts a custom BookmarksProperties object that contains, among other things, the modified fields and current sheet. In enigma-go, the equivalent method only accepts a generic NxInfo and NxMetaDef. There is a CreateBookmarkRaw method that accepts an interface, so it's possible to pass properties dynamically.

Create a helper struct to enable full functionality using CreateBookmark or document how to use CreateBookmarkRaw with an example.

@SeBBBe SeBBBe added the enhancement New feature or request label Jan 22, 2019
@SeBBBe
Copy link
Author

SeBBBe commented Jan 24, 2019

I have gotten it working using code as follows:

`
// Construct the required fields dynamically
metaDef := make(map[string]interface{})
metaDef["description"] = settings.Description
metaDef["title"] = settings.Title

nxInfo := enigma.NxInfo{
	Id:   settings.Id,
	Type: "bookmark",
}

// Mirrors the fields in the SDK
props := make(map[string]interface{})
props["sheetId"] = sheet.ID
props["selectionFields"] = fields
props["creationDate"] = time.Now().Format("01/02/06 ") // US short date format
props["qMetaDef"] = metaDef
props["qInfo"] = nxInfo`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant