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

Smartsheet Integration choice issue whith picklist array #298

Open
joenilson opened this issue May 10, 2023 · 2 comments
Open

Smartsheet Integration choice issue whith picklist array #298

joenilson opened this issue May 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@joenilson
Copy link
Contributor

I'm creating an smartsheet integration manifest, it connects using API but when i need to consume a List (PICKLIST) from smartssheet to populate the form manifest i get an error:

Form item (Select Company to add user to) could not be rendered. Format was different than expected.
Expected format:

{
    "options": [
        {
            "id": 0,
            "name": "name 0"
        },
        {
            "id": 1,
            "name": "name 1"
        }
    ]
}

Smartsheet return the PICKLIST in this form:

{
    "id": columnID,
    "version": 0,
    "index": 1,
    "title": "Company",
    "type": "PICKLIST",
    "options": [
        "Company One",
        "Company Two",
        "Company Three",
        "Company Four"
    ],
    "validation": false,
    "width": 200
}

Looking at the documentation i see that we need to get in array form, the manifest is setup as:

{
    "form": [
        {
            "id": "companyID",
            "url": "https://api.smartsheet.com/2.0/sheets/{{SHEET_ID}}/columns/columnID",
            "name": "Select Company to add user to",
            "type": "choice",
            "method": "GET",
            "data_from": "options"
        }
}

I want to understand how to handle in this case the choice option, i know one option is using the items fixed list, but the picklist is updated often and we need to keep this with the new items.

@GDay
Copy link
Member

GDay commented May 10, 2023

Hmm.. yeah, that's an issue. It currently does not support an array with strings, it always expects an array with objects in it. So, that's not going to work right now.

One workaround that might work: grab the cells of that column and then use the value of the cell as the option. If I remember right, it will remove the duplicates. This will only work if all options are currently in at least one o the cells.

@joenilson
Copy link
Contributor Author

For the moment this is an experimental integration for our actual onboarding process, i will make more test meanwhile i learn django to help with some onboarding reports and quick fixes.

@GDay GDay added the enhancement New feature or request label May 24, 2023
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

2 participants