Hello @iskinderun
Yes of course, but you will need to read the JSON from the external URL with some additional code.
For example, assuming you want to populate the fieldname1 field in the form with this rate, you can insert a “HTML Content” field in the form with the following piece of code as its content:
<script>
fbuilderjQuery(document).one('showHideDepEvent', function(){
fbuilderjQuery.getJSON( 'https://api.manana.kr/exchange/rate/KRW/USD.json', function(data){fbuilderjQuery('[id*="fieldname1_"]').val(data[0]['rate']);} );
});
</script>
and that’s all.
I’m sorry, but the support service does not cover the implementation of the users’ projects (forms or formulas). If you need additional help implementing your project, I can offer you custom coding service from my private website:
https://cff.dwbooster.com/customization
Best regards.
Oh great I’m crying. Thank you very much!
-
This reply was modified 7 years, 3 months ago by
iskinderun.
fbuilderjQuery(document).one(‘showHideDepEvent’, function(){
fbuilderjQuery.getJSON( ‘https://api.manana.kr/exchange/rate/KRW/USD.json’, function(data){fbuilderjQuery(‘[id*=”fieldname1_”]’).val(data[0][‘rate’]);} );
});
.val(data[0], how to change the 0 by fieldname input?
Hello @fatih71
If you want to replace the number 0 with the value of a field in the form, for example, the value of the field 34, the code to use would be:
fbuilderjQuery('[id*="fieldname34_"]').val()
Best regards.
Thank you, so it would be like this:
fbuilderjQuery(document).one(‘showHideDepEvent’, function(){
fbuilderjQuery.getJSON( ‘https://api.manana.kr/exchange/rate/KRW/USD.json’, function(data){fbuilderjQuery(‘[id*=”fieldname1_”]’).val(data[fbuilderjQuery(‘[id*=”fieldname34_”]’).val()][‘rate’]);} );
});
Hello @fatih71
Exactly, at least the structure is correct.
Best regards.