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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Suriyanarayanan V 45
oliver.rodrigues 14 Most Valuable Professional
DP_Prabh 13