You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flexable asset fields does not accept new lines for type select #3
Trying to create a new flexible asset type with files and when I create a select, new lines are ignored. I tried both \n and rn (the last one worked with contacts in notes).
Here is my code. I tried using options in attributes but it gave me an error, saying I need default_value (should be noted that they used options instead of default_value in their example...). Any ideas?
$body = @{
data = @{
type = 'flexible_asset_types'
attributes = @{
name = 'Office 365 TEST'
description = 'Document any Office 365 subscription setup for a customer'
icon = 'Word'
show_in_menu = $true
}
relationships = @{
flexible_asset_fields = @{
data = @(
@{
type = 'flexible_asset_fields'
attributes = @{
order = 1
name = 'Office 365 subscription type'
kind = 'Select'
hint = 'What subscription is in use for the customer. You will find it under Office Admin Center, billing.'
default_value = 'Office 365 Business\nOffice 365 Business Essentials\nOffice 365 Business Premium\nOffice 365 ProPlus\nOffice 365 Enterprise E1\nOffice 365 Enterprise E3\nOffice 365 Enterprise E5'
required = $true
show_in_list = $true
}
}
)
}
}
}
}
New-ITGlueFlexibleAssetTypes -data $body
Error when using options instead of default_value:
Hey ecspresso,
I believe this is an artifact of the actual API, not the PowerShell
wrapper. Since IT Glue's data is and formatted in HTML, you should be able
to use `<p></p>` tags, or perhaps a `<br />` to act as a new line.
As an aside, this also means that you can create tables and buttons via
HTML formatting in the API as well.
On Mon, Feb 5, 2018, 10:37 AM ecspresso ***@***.***> wrote:
Trying to create a new flexible asset type with files and when I create a
select, new lines are ignored. I tried both \n and rn (the last one
worked with contacts in notes).
Here is my code. I tried using options in attributes but it gave me an
error, saying I need default_value (should be noted that they used options
instead of default_value in their example...). Any ideas?
$body = @{
data = @{
type = 'flexible_asset_types'
attributes = @{
name = 'Office 365 TEST'
description = 'Document any Office 365 subscription setup for a customer'
icon = 'Word'
show_in_menu = $true
}
relationships = @{
flexible_asset_fields = @{
data = @(
@{
type = 'flexible_asset_fields'
attributes = @{
order = 1
name = 'Office 365 subscription type'
kind = 'Select'
hint = 'What subscription is in use for the customer. You will find it under Office Admin Center, billing.'
default_value = 'Office 365 Business\nOffice 365 Business Essentials\nOffice 365 Business Premium\nOffice 365 ProPlus\nOffice 365 Enterprise E1\nOffice 365 Enterprise E3\nOffice 365 Enterprise E5'
required = $true
show_in_list = $true
}
}
)
}
}
}
}
New-ITGlueFlexibleAssetTypes -data $body
Error when using options instead of default_value:
{
"errors": [
{
"source": {
"pointer": "/data/attributes/flexible-asset-fields.default-value"
},
"detail": "can't be blank",
"title": "Unprocessable Entity",
"status": 422
}
]
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGx9-u4YzKltbKr8rrBh5Rlr_Q1Tr_wfks5tRy5ggaJpZM4R5u6r>
.
Activity
CalebAlbers commentedon Feb 5, 2018
ecspresso commentedon Feb 6, 2018
Solved it buy using double quotes instead of single quotes. I just learned that you cannot use ` inside of single quotes.
CalebAlbers commentedon Feb 6, 2018
Good catch! I wasn't aware of that.
Merge pull request #3 from intellicomp/Attachments