Notifications
Announcements
I have a fetchxml that returns one record. I put it in liquid.
The value of one field from this record has to be used further as URL for HTTP request. (ajax in javascript)
How can I do this?
Hi @eliz_talent,
I typically use hidden inputs to host singular variables like that. E.g.:
{% assign acct = entities.account[params.id] %} {% if acct %} {% assign acctHiddenStuff = acct.new_hiddenstuff %} {% endif %} <input type="hidden" id="hiddenStuff" value="{{ acctHiddenStuff }}">
used with
var hiddenStuff = $("#hiddenStuff").val(); if (hiddenStuff !== "") { // do something }
Hi @justinburch,
thank you for your time and the response.
how can I assign a value if I do not have the id of the setting record (I fetch top 1 record)?
Current code does not work for me, URL remains empty:
{% for item in settingsFetch.results.entities %}{% assign url = {{item.url}} %}{% endfor %}
I have found a solution. I didn't give me the permission to read this entity and the fetch was empty.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Fubar 83 Super User 2025 Season 2
Jerald Felix 42
Lucas001 25 Super User 2025 Season 2