Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need help defining variable for webviewer

Featured Replies

Hello,

I try to master the webviewer to use as a line chart.

I'm nearly there if I input values one by one but I know that you can work with variables too!

Can you help me in how to define a variable:

The Y-axe is supposed to contain all the values of a field in a table.

The variable has to be named &y.

For example :P the y-axe needs to show/contain all values from the field 1603 from table FUP.

Kind regards

What's "1603" again? Hopefully that's not the name of a field.

You'll either need to use the List() function on a related field, where the relationship is a self-join, use a script to loop through and Set Field[], or use a script to Copy All Records and Paste into a global to assemble the field values into a single field. Once you have the values in a return-separated list, you can use a substitute() function to substitute whatever separator you wish in place of the ¶ separating the lines.

  • Author

Yes 1603 is the name of a field. I know it isn't good. But it would take me too long to explain why. Believe there is a good reason :P

Hmm that seems complicated. I'll need to sit back and think about it cause I'm not really into scripting.

I had a example that uses getnthrecord but it doesn't seem to work on my project?

Can't you write some code ?

Again kind regards !

Sure, you could use GetNthRecord() in a custom function, but I think that would be slower that using List(). I suppose if the found sets are likely to be small, then that may be a good way to go (less overhead). You can find a CF for appending the items in the found set here:

http://www.clevelandconsulting.com/support/viewtopic.php?t=637

If you wish, you can simply replace the ¶ in that function with your desired separator (in quotes).

If you want to go the List() route, I think you'll learn more by taking a stab at it first. If you get stuck, let us know.

In any case, I strongly recommend you rename any fields you have with number names. Otherwise it's pretty awkward to use those in calcs or scripts.

Edited by Guest

  • Author

Tx a lot.

I finally managed to do it with the simple list function.

Can you help me with the subsitute syntax.

Now I have :P

setvariable[$list;value:list(FUP::P${1603}]

set field[Chart Attributes::list;$list]

This gives me a result in the field 'list' as folows =

1

2

3

4

How can write it that the result becomes :

1,2,3,4

Kind Regards

Edited by Guest

  • Author

Ok that part I resolved using Find/Replace.

But I encountered another problem :P

The graph doesn't accept ',' values like 2,5

So I need to round automaticly the values?

But I can't figure out where to do it, here are the steps :P

set variable

set field

go to layout

go to field

perform find/replace

To keep it simple, you can define a calculation field in the FUP table =

Round ( ${1603} ; 0 )

Then you can do the rest in one step:

Set Field [ Chart Attributes::list ; Substitute ( List ( FUP::calcField ) ; ¶ ; "," ) ]

  • Author

That worked fine, brilliant

Many thanks to all

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.