You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Dear all,
I try to create a small confluence page, which allow creation of one or multiple Insight object depending of value entered in a Custom Field.
This works when I entered only one value, but copy/paste of multi rows return this kind of error:
Could not prepare JSON: '{ "objectTypeId": 1, "attributes": [{ "objectTypeAttributeId": 11, "objectAttributeValues": [{ "value": 123456 4523657 }] } ] }'. Invalid format. Expected a ',' or '}' at 150 [character 1 line 7]
On My IFTTT integration rules, I use a Create Insight Object, and then on No Format macro the following code:
{
"objectTypeId": 1,
"attributes": [{
"objectTypeAttributeId": 11,
"objectAttributeValues": [{
"value": [entry.mymultivalueareafield.transform(id).asArrayOfKVPairs(key)]
}]
}
]
}
How I can implement that?
thanks in advance.
regards
Hi
are you using NoFormat or Code macro to wrap (and pass) your Insight Object JSON mapping to ConfiForms?
Also, you have [entry.mymultivalueareafield.transform(id).asArrayOfKVPairs(key)] in the mapping, but shared something else in the error message
As this instruction, when properly used, will produce something like
{"key": "someID", "key": "anotherID"}
Alex
Dear Alex,
thank you for your quick answer.
Yes, I use a "No Format" macro in the IFTTT macro to store the JSON. And indeed, the error message is strange, I don't understand it. It's like if the tool didn't recognize the line break.
Is there a way to log/ debug such kind of script (i.e console which step by step shows the values...) ?
regards,
Xavier
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error is actually correct, as
"value": 123456 4523657
is not a correct JSON
So, your instruction
[entry.mymultivalueareafield.transform(id).asArrayOfKVPairs(key)]
is incorrect
I suggest to do the following
Create a ConfiForms PlainView and put this expression inside the macro body
See what it produces
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Alex,
thank you for your post. this product data with blank data instead comma, line break...
will check for correct formatting
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What field type this
mymultivalueareafield
field actually is?
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
textarea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I am confused now.. you are talking about textarea in the subject of the ticket, but in your JSON you have something like
mymultivalueareafield
using transform function...
What is your question really? How does this textarea field plays here!?
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, On my form, I have one field (of type textarea, with the name mymultivalueareafield) on which I would like to entered or copy/paste values, eventually separate by carriage return
So, on the IFTTT, (Create Insight Object), I add a No Format macro, and entered
{
"objectTypeId": 1,
"attributes": [{
"objectTypeAttributeId": 11,
"objectAttributeValues": [{
"value": [entry.mymultivalueareafield.transform(id).asArrayOfKVPairs(key)]
}]
}
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Honestly, I dont understand what are you trying to "transform by id" in text area... this field has no "id"... and is not multi-value (multi-select).
Something like this might work...
[entry.mymultivalueareafield.replaceCRLFWithBR.split(<br/>).asArrayOfKVPairs(key)]
Alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.