Hello, I am trying to make a prototype Bluesky custom app in Make, and right now, I’m trying to figure out how to hide this specific JSON if none had entered a parameter.
It goes like this.
"repo": "{{temp.sessionDID}}",
"collection": "app.bsky.feed.post",
"record": {
"$type": "app.bsky.feed.post",
"text": "{{parameters.status}}",
"createdAt": "{{formatDate(now, 'YYYY-MM-DDTHH:mm:ss.sssZ')}}",
"facets": [
{ // Mention Username
"index": {
"byteStart": "{{parseNumber(parameters.mentions[].userByteStart)}}",
"byteEnd": "{{parseNumber(parameters.mentions[].userByteEnd)}}"
},
"features": [
{
"$type": "{{if(parameters.mentions[].blueskyUserName != null , \"app.bsky.richtext.facet#mention\")}}",
"did": "{{parameters.mentions[].blueskyUserName}}"
}
]
},
{ // Add Link
"index": {
"byteStart": "{{parseNumber(parameters.mentions[].urlByteStart)}}",
"byteEnd": "{{parseNumber(parameters.mentions[].urlByteEnd)}}"
},
"features": [
{
"$type": "{{if(parameters.mentions[].urlLink != null , \"app.bsky.richtext.facet#link\")}}",
"did": "{{parameters.mentions[].urlLink}}"
}
]
}
]
}
as the parameter facets
is a array parameter, I wanted a way to see that if there is NO value, then would there be a way to hide either the “Mention Username” or “Add Link” if NO value had entered in the parameters.
I tried this long way "facets": [ "{{if(parameters.mentions !== null, {\"index\":{\"byteStart\":\"{{parseNumber(parameters.mentions[].userByteStart)}}\",\"byteEnd\":\"{{parseNumber(parameters.mentions[].userByteEnd)}}\"},\"features\":[{\"$type\":\"{{if(parameters.mentions[].blueskyUserName != null , \\\"app.bsky.richtext.facet#mention\\\")}}\",\"did\":\"{{parameters.mentions[].blueskyUserName}}\"}]}}}", ]
It is crazy long, I know, I had to minify it, and to no avail. I tested it out on a RequestBIN, and it came out as this.
Is there a workaround to this? I can’t find anything on the documatation.