# JSON from only the fields on a layout?

**URL:** <https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384>\
**Category:** Questions\
**Tags:** array, loop, variable\
**Created:** [August 3, 2021, 10:29pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384 "2021-08-03T22:29:14Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Torsten](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/torsten/32/1574_2.png) [@Torsten](https://the.fmsoup.org/u/Torsten)\
**Post date:** [August 4, 2021, 8:32pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/21 "2021-08-04T20:32:25Z")

</div>

This should not be a problem, you may give it a try. From other posts in this thread I learned that the limiting factor in your case is bandwidth.

---

<div class="post-metadata">

**Author:** ![kerplop](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kerplop](https://the.fmsoup.org/u/kerplop)\
**Post date:** [August 4, 2021, 9:15pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/22 "2021-08-04T21:15:39Z")

</div>

Seems like it, thanks.

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [August 4, 2021, 11:36pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/23 "2021-08-04T23:36:38Z")

</div>

Is it possible to setup an account on the remote server, then use a remote desktop connection to get in? That tends to work well in situations like yours.

I SSH into remote hosts from the command line with this config:

```auto
Host remoteServer
    # HostName IP.V4.xx.xxx
    HostName domain.name.here
    Port 22
    User user_account
    LocalForward 5999 127.0.0.1:5900

```

You could use a dedicated app for the screen sharing if you prefer but I use the Go menu in Finder on my Mac to screen share. I type in the localhost address and port number and the remote screen pops up.

`vnc://localhost:5999`

The screen quality can be poor and laggy when the connection is bad. However, all the action is taking place on the remote system, so your connection can drop out without interrupting the session on the remote machine.

---

<div class="post-metadata">

**Author:** ![thesoftwareman](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/thesoftwareman/32/720_2.png) [@thesoftwareman](https://the.fmsoup.org/u/thesoftwareman)\
**Post date:** [August 6, 2021, 12:22pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/24 "2021-08-06T12:22:01Z")

</div>

I made a custom function that builds the JSON from the fields on a layout with the while function.

JSONGetRecord : no params

- 
  - 

JSONFormatElements (

While ( [  
fields = FieldNames ( Get(FileName); Get(LayoutName) );  
f = 1;  
json = ""  
];

f \<= ValueCount ( fields );

[  
n = GetValue(fields; f);  
json = JSONSetElement ( json ; n; Evaluate(n) ; JSONString );  
f = f + 1  
];

json )

)

---

<div class="post-metadata">

**Author:** ![bdphifer](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@bdphifer](https://the.fmsoup.org/u/bdphifer)\
**Post date:** [August 6, 2021, 4:27pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/25 "2021-08-06T16:27:18Z")

</div>

Your Custom Function looks interesting.

Does it pull data from Portals? Will it put that data in an array within that particular record?

Thanks!

---

<div class="post-metadata">

**Author:** ![kerplop](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kerplop](https://the.fmsoup.org/u/kerplop)\
**Post date:** [August 6, 2021, 4:59pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/26 "2021-08-06T16:59:23Z")

</div>

Hi Malcolm, thanks for the tip. I do have access to screenshare to a Mac with faster access to the server. However, I can't always access that Mac.

---

<div class="post-metadata">

**Author:** ![kerplop](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kerplop](https://the.fmsoup.org/u/kerplop)\
**Post date:** [August 6, 2021, 5:04pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/27 "2021-08-06T17:04:55Z")

</div>

Thanks for this custom function. I'm assuming I run it as a script step. I successfully got all the field data on a layout into a field, and can extract individual field info. Thanks!

---

<div class="post-metadata">

**Author:** ![thesoftwareman](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/thesoftwareman/32/720_2.png) [@thesoftwareman](https://the.fmsoup.org/u/thesoftwareman)\
**Post date:** [August 10, 2021, 8:58pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/28 "2021-08-10T20:58:48Z")

</div>

I have not tried portals yet.  
I usually go to individual tables, find, and upload records.

---

<div class="post-metadata">

**Author:** ![thesoftwareman](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/thesoftwareman/32/720_2.png) [@thesoftwareman](https://the.fmsoup.org/u/thesoftwareman)\
**Post date:** [August 10, 2021, 8:59pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/29 "2021-08-10T20:59:20Z")

</div>

Also, it probably won't handle repeating fields well.

---

<div class="post-metadata">

**Author:** ![KyleWilliams](https://avatars.discourse-cdn.com/v4/letter/k/ecccb3/32.png) [@KyleWilliams](https://the.fmsoup.org/u/KyleWilliams)\
**Post date:** [August 16, 2021, 5:35pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/30 "2021-08-16T17:35:45Z")

</div>

I have demonstrated how to do this a few times during my presentations on RCC's channel.

Here is a link to my presentation of how to create a formula to get the current found set as JSON that should help:

"[Dead Bird and Open Q&A - Free FileMaker Sample Files from the Viewers - YouTube](https://www.youtube.com/watch?v=5BZKdLOidSk)"

My presentation starts at around 12 minutes into the video..

Here is a link to the demo file I created: [KyleW - Demo - Create JSON From Found Set v12.zip](https://bit.ly/3kt98vT)

---

<div class="post-metadata">

**Author:** ![kerplop](https://avatars.discourse-cdn.com/v4/letter/k/848f3c/32.png) [@kerplop](https://the.fmsoup.org/u/kerplop)\
**Post date:** [August 18, 2021, 4:24pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/31 "2021-08-18T16:24:31Z")

</div>

Thanks, Kyle, will check it out!

---

<div class="post-metadata">

**Author:** ![thesoftwareman](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/thesoftwareman/32/720_2.png) [@thesoftwareman](https://the.fmsoup.org/u/thesoftwareman)\
**Post date:** [August 19, 2021, 12:59pm UTC](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384/32 "2021-08-19T12:59:10Z")

</div>

Nice work Kyle!

[Previous page](https://the.fmsoup.org/t/json-from-only-the-fields-on-a-layout/2384.md?page=1)
