JSON structure / issues (general thread)

Oh, indeed weird. I'll try to debug it as well in few minutes too :slight_smile:

I've playd with chrome a little bit, checked the request that was made with window.location method that you mentioned and found out that this was the request URL that window.location created:

http://127.0.0.1:60699/trigger_action/?json={%20%22BTTTriggerType%22%20:%20643,%20%22BTTTriggerTypeDescription%22%20:%20%22Named%20Trigger:%20testtest%22,%20%22BTTTriggerClass%22%20:%20%22BTTTriggerTypeOtherTriggers%22,%20%22BTTPredefinedActionType%22%20:%205,%20%22BTTPredefinedActionName%22%20:%20%22Mission%20Control%22,%20%22BTTTriggerName%22%20:%20%22testtest%22,%20%22BTTEnabled2%22%20:%201,%20%22BTTUUID%22%20:%20%2291D54385-467F-44BC-9979-185A6D1EA1D0%22,%20%22BTTEnabled%22%20:%201,%20%22BTTOrder%22%20:%200,%20%22BTTTriggerConfig%22%20:%20{%20%22BTTHUDText%22%20:%20%22%F0%9F%98%80%22,%20%22BTTHUDDetailText%22%20:%20%22%F0%9F%A4%A3%22,%20%22BTTShowHUD%22%20:%201%20}%20}

click

(i've changed the port so it'd work out for you)

Sooo... turns out that the request has to be somehow specially encoded :thinking: But I have no idea how.

The url i provied should work normally in all cases (it did where I tested it).

I have found a way that seems to work:

1.) Copy the json and url encode it (e.g. using https://www.urlencoder.org/ )
2.) Write your url as http://127.0.0.1:12345/trigger_action/?json=the_encoded_json
3.) This works at least when putting it into a normal html file. Maybe this forum somehow breaks the links.

xxx

//edit: yep the forum is breaking the links.... that's why it wasn't working.

Right! Encoding the JSON in JS via encodeURIComponent did work, now both diacritics and emojis works :slight_smile: awesome, thank you once again for your support :tada::tada::tada:

1 Like

Awesome! I'm still a bit confused because when viewing the source of the links here in the forum they look exactly the same as in my custom html. However when clicking them they are cut off after the BTTEnabled2 part... Can't see why this happens, especially because it works when either opening in a new tab or right-clicking and copying the links

When I turned off the JavaScript on the current page - the links works. With JS enabled - they no longer work. So I guess the CMS you're using for this community has some custom event listeners set up for links and breaks them :confused: That would probably would need some manual tweaks..

1 Like

Ahh indeed that's it.